MCPcopy Create free account
hub / github.com/ElementsProject/elements / BlockMerkleBranch

Function BlockMerkleBranch

src/test/merkle_tests.cpp:119–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119static std::vector<uint256> BlockMerkleBranch(const CBlock& block, uint32_t position)
120{
121 std::vector<uint256> leaves;
122 leaves.resize(block.vtx.size());
123 for (size_t s = 0; s < block.vtx.size(); s++) {
124 leaves[s] = block.vtx[s]->GetHash();
125 }
126 return ComputeMerkleBranch(leaves, position);
127}
128
129// Older version of the merkle root computation code, for comparison.
130static uint256 BlockBuildMerkleTree(const CBlock& block, bool* fMutated, std::vector<uint256>& vMerkleTree)

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 4

ComputeMerkleBranchFunction · 0.85
resizeMethod · 0.45
sizeMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected