diff options
author | Pieter Wuille <pieter@wuille.net> | 2020-06-26 13:36:41 -0700 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2020-07-30 13:57:54 -0700 |
commit | 77c507358bda9bd6c496f33e0f4418c0603bb08d (patch) | |
tree | 53e59bb680078392dbc32315c0b0f2adcde882f9 /src/test/merkle_tests.cpp | |
parent | 02c4cc5c5ddf61f98ee366a4bea8abc26de492bd (diff) |
Make Hash[160] consume range-like objects
Diffstat (limited to 'src/test/merkle_tests.cpp')
-rw-r--r-- | src/test/merkle_tests.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/test/merkle_tests.cpp b/src/test/merkle_tests.cpp index 77bc601712..9bc7cc5dab 100644 --- a/src/test/merkle_tests.cpp +++ b/src/test/merkle_tests.cpp @@ -13,9 +13,9 @@ static uint256 ComputeMerkleRootFromBranch(const uint256& leaf, const std::vecto uint256 hash = leaf; for (std::vector<uint256>::const_iterator it = vMerkleBranch.begin(); it != vMerkleBranch.end(); ++it) { if (nIndex & 1) { - hash = Hash(it->begin(), it->end(), hash.begin(), hash.end()); + hash = Hash(*it, hash); } else { - hash = Hash(hash.begin(), hash.end(), it->begin(), it->end()); + hash = Hash(hash, *it); } nIndex >>= 1; } @@ -144,8 +144,7 @@ static uint256 BlockBuildMerkleTree(const CBlock& block, bool* fMutated, std::ve // Two identical hashes at the end of the list at a particular level. mutated = true; } - vMerkleTree.push_back(Hash(vMerkleTree[j+i].begin(), vMerkleTree[j+i].end(), - vMerkleTree[j+i2].begin(), vMerkleTree[j+i2].end())); + vMerkleTree.push_back(Hash(vMerkleTree[j+i], vMerkleTree[j+i2])); } j += nSize; } |