Merge pull request #4926

584a358 Do merkle root and txid duplicates check simultaneously (Pieter Wuille)
This commit is contained in:
Pieter Wuille
2014-10-02 06:05:02 +02:00
3 changed files with 57 additions and 17 deletions

View File

@@ -529,7 +529,11 @@ public:
return block;
}
uint256 BuildMerkleTree() const;
// Build the in-memory merkle tree for this block and return the merkle root.
// If non-NULL, *mutated is set to whether mutation was detected in the merkle
// tree (a duplication of transactions in the block leading to an identical
// merkle root).
uint256 BuildMerkleTree(bool* mutated = NULL) const;
std::vector<uint256> GetMerkleBranch(int nIndex) const;
static uint256 CheckMerkleBranch(uint256 hash, const std::vector<uint256>& vMerkleBranch, int nIndex);