BIP141: Commitment structure and deployment
Includes a fix by Suhas Daftuar and LongShao007
This commit is contained in:
@@ -165,6 +165,17 @@ uint256 BlockMerkleRoot(const CBlock& block, bool* mutated)
|
||||
return ComputeMerkleRoot(leaves, mutated);
|
||||
}
|
||||
|
||||
uint256 BlockWitnessMerkleRoot(const CBlock& block, bool* mutated)
|
||||
{
|
||||
std::vector<uint256> leaves;
|
||||
leaves.resize(block.vtx.size());
|
||||
leaves[0].SetNull(); // The witness hash of the coinbase is 0.
|
||||
for (size_t s = 1; s < block.vtx.size(); s++) {
|
||||
leaves[s] = block.vtx[s].GetWitnessHash();
|
||||
}
|
||||
return ComputeMerkleRoot(leaves, mutated);
|
||||
}
|
||||
|
||||
std::vector<uint256> BlockMerkleBranch(const CBlock& block, uint32_t position)
|
||||
{
|
||||
std::vector<uint256> leaves;
|
||||
|
||||
Reference in New Issue
Block a user