Skip to content

Commit 61872fd

Browse files
handle empty hash
1 parent d5ebfa7 commit 61872fd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dash/src/sml/masternode_list/from_diff.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::collections::BTreeMap;
2-
31
use crate::bls_sig_utils::BLSSignature;
42
use crate::network::message_sml::MnListDiff;
53
use crate::sml::error::SmlError;
@@ -11,6 +9,8 @@ use crate::sml::quorum_entry::qualified_quorum_entry::{
119
QualifiedQuorumEntry, VerifyingChainLockSignaturesType,
1210
};
1311
use crate::{BlockHash, Network};
12+
use hashes::Hash;
13+
use std::collections::BTreeMap;
1414

1515
pub trait TryFromWithBlockHashLookup<T>: Sized {
1616
type Error;
@@ -67,7 +67,9 @@ impl TryFromWithBlockHashLookup<MnListDiff> for MasternodeList {
6767
{
6868
if let Some(genesis_block_hash) = network.known_genesis_block_hash() {
6969
// Check if the base block is the genesis block
70-
if diff.base_block_hash != genesis_block_hash {
70+
if diff.base_block_hash != genesis_block_hash
71+
&& diff.base_block_hash.as_byte_array() != &[0; 32]
72+
{
7173
return Err(SmlError::BaseBlockNotGenesis(diff.base_block_hash));
7274
}
7375
}

0 commit comments

Comments
 (0)