Skip to content

Commit 579f731

Browse files
authored
Fix crash when applying empty diff to an empty masternode list (#116)
* Fix crash when applying empty diff to an empty masternode list
1 parent ee30e52 commit 579f731

File tree

3 files changed

+7947
-3
lines changed

3 files changed

+7947
-3
lines changed

lib/deterministicmnlist/SimplifiedMNList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ SimplifiedMNList.prototype.applyDiff = function applyDiff(simplifiedMNListDiff)
5353
this.deleteMNs(diff.deletedMNs);
5454
this.addOrUpdateMNs(diff.mnList);
5555

56-
this.lastDiffMerkleRootMNList = diff.merkleRootMNList;
56+
this.lastDiffMerkleRootMNList = diff.merkleRootMNList || constants.NULL_HASH;
5757
this.merkleRootMNList = this.calculateMerkleRoot();
5858

5959
if (!this.verify()) {

0 commit comments

Comments
 (0)