Merge pull request #6508
eece63fSwitch blocks to a constant-space Merkle root/branch algorithm. (Pieter Wuille)ee60e56Add merkle.{h,cpp}, generic merkle root/branch algorithm (Pieter Wuille)
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "checkpoints.h"
|
||||
#include "checkqueue.h"
|
||||
#include "consensus/consensus.h"
|
||||
#include "consensus/merkle.h"
|
||||
#include "consensus/validation.h"
|
||||
#include "hash.h"
|
||||
#include "init.h"
|
||||
@@ -2876,7 +2877,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
|
||||
// Check the merkle root.
|
||||
if (fCheckMerkleRoot) {
|
||||
bool mutated;
|
||||
uint256 hashMerkleRoot2 = block.ComputeMerkleRoot(&mutated);
|
||||
uint256 hashMerkleRoot2 = BlockMerkleRoot(block, &mutated);
|
||||
if (block.hashMerkleRoot != hashMerkleRoot2)
|
||||
return state.DoS(100, error("CheckBlock(): hashMerkleRoot mismatch"),
|
||||
REJECT_INVALID, "bad-txnmrklroot", true);
|
||||
|
||||
Reference in New Issue
Block a user