mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-18 19:47:53 +02:00
merkle: remove unused mutated arg from BlockWitnessMerkleRoot
The `mutated` parameter is never used at any call site - all callers pass `nullptr`. The explicit comment in `validation.cpp` explains the reason: // The malleation check is ignored; as the transaction tree itself // already does not permit it, it is impossible to trigger in the // witness tree.
This commit is contained in:
@@ -73,7 +73,7 @@ uint256 BlockMerkleRoot(const CBlock& block, bool* mutated)
|
||||
return ComputeMerkleRoot(std::move(leaves), mutated);
|
||||
}
|
||||
|
||||
uint256 BlockWitnessMerkleRoot(const CBlock& block, bool* mutated)
|
||||
uint256 BlockWitnessMerkleRoot(const CBlock& block)
|
||||
{
|
||||
std::vector<uint256> leaves;
|
||||
leaves.resize(block.vtx.size());
|
||||
@@ -81,7 +81,7 @@ uint256 BlockWitnessMerkleRoot(const CBlock& block, bool* mutated)
|
||||
for (size_t s = 1; s < block.vtx.size(); s++) {
|
||||
leaves[s] = block.vtx[s]->GetWitnessHash().ToUint256();
|
||||
}
|
||||
return ComputeMerkleRoot(std::move(leaves), mutated);
|
||||
return ComputeMerkleRoot(std::move(leaves));
|
||||
}
|
||||
|
||||
/* This implements a constant-space merkle path calculator, limited to 2^32 leaves. */
|
||||
|
||||
@@ -20,9 +20,8 @@ uint256 BlockMerkleRoot(const CBlock& block, bool* mutated = nullptr);
|
||||
|
||||
/*
|
||||
* Compute the Merkle root of the witness transactions in a block.
|
||||
* *mutated is set to true if a duplicated subtree was found.
|
||||
*/
|
||||
uint256 BlockWitnessMerkleRoot(const CBlock& block, bool* mutated = nullptr);
|
||||
uint256 BlockWitnessMerkleRoot(const CBlock& block);
|
||||
|
||||
/**
|
||||
* Compute merkle path to the specified transaction
|
||||
|
||||
Reference in New Issue
Block a user