Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Go to the documentation of this file. 47 bool mutation =
false;
48 while (hashes.size() > 1) {
50 for (
size_t pos = 0; pos + 1 < hashes.size(); pos += 2) {
51 if (hashes[pos] == hashes[pos + 1]) mutation =
true;
54 if (hashes.size() & 1) {
55 hashes.push_back(hashes.back());
57 SHA256D64(hashes[0].begin(), hashes[0].begin(), hashes.size() / 2);
58 hashes.resize(hashes.size() / 2);
60 if (mutated) *mutated = mutation;
61 if (hashes.size() == 0)
return uint256();
68 std::vector<uint256> leaves;
69 leaves.resize(block.
vtx.size());
70 for (
size_t s = 0; s < block.
vtx.size(); s++) {
71 leaves[s] = block.
vtx[s]->GetHash();
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
uint256 ComputeMerkleRoot(std::vector< uint256 > hashes, bool *mutated)
std::vector< CTransactionRef > vtx
void SHA256D64(unsigned char *out, const unsigned char *in, size_t blocks)
Compute multiple double-SHA256's of 64-byte blobs.