mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-11 15:48:05 +00:00
Merge pull request #2890 from cozz/cozz1
do not call BuildMerkleTree() unnecessarily twice
This commit is contained in:
commit
ac1bd701ba
@ -2264,7 +2264,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
|
|||||||
return state.DoS(100, error("CheckBlock() : out-of-bounds SigOpCount"));
|
return state.DoS(100, error("CheckBlock() : out-of-bounds SigOpCount"));
|
||||||
|
|
||||||
// Check merkle root
|
// Check merkle root
|
||||||
if (fCheckMerkleRoot && block.hashMerkleRoot != block.BuildMerkleTree())
|
if (fCheckMerkleRoot && block.hashMerkleRoot != block.vMerkleTree.back())
|
||||||
return state.DoS(100, error("CheckBlock() : hashMerkleRoot mismatch"));
|
return state.DoS(100, error("CheckBlock() : hashMerkleRoot mismatch"));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user