MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ComputeModifiedMerkleRoot

Function ComputeModifiedMerkleRoot

src/signet.cpp:59–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59static uint256 ComputeModifiedMerkleRoot(const CMutableTransaction& cb, const CBlock& block)
60{
61 std::vector<uint256> leaves;
62 leaves.reserve((block.vtx.size() + 1) & ~1ULL); // capacity rounded up to even
63 leaves.push_back(cb.GetHash().ToUint256());
64 for (size_t s = 1; s < block.vtx.size(); ++s) {
65 leaves.push_back(block.vtx[s]->GetHash().ToUint256());
66 }
67 return ComputeMerkleRoot(std::move(leaves));
68}
69
70std::optional<SignetTxs> SignetTxs::Create(const CBlock& block, const CScript& challenge)
71{

Callers 1

CreateMethod · 0.85

Calls 5

ComputeMerkleRootFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected