Browse Source

do not call BuildMerkleTree() unnecessarily twice

0.10
Cozz Lovan 11 years ago
parent
commit
c7fa1a3586
  1. 2
      src/main.cpp

2
src/main.cpp

@ -2264,7 +2264,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo @@ -2264,7 +2264,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
return state.DoS(100, error("CheckBlock() : out-of-bounds SigOpCount"));
// 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 true;

Loading…
Cancel
Save