Skip to content

Commit 7fa238c

Browse files
committed
Replace use of BEGIN and END macros on uint256
Replace use of `BEGIN` and `END` macros on uint256 with `begin()` and `end()` methods in the Merkle tree code.
1 parent 5da08e0 commit 7fa238c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/merkleblock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ uint256 CPartialMerkleTree::CalcHash(int height, unsigned int pos, const std::ve
5353
else
5454
right = left;
5555
// combine subhashes
56-
return Hash(BEGIN(left), END(left), BEGIN(right), END(right));
56+
return Hash(left.begin(), left.end(), right.begin(), right.end());
5757
}
5858
}
5959

@@ -109,7 +109,7 @@ uint256 CPartialMerkleTree::TraverseAndExtract(int height, unsigned int pos, uns
109109
right = left;
110110
}
111111
// and combine them before returning
112-
return Hash(BEGIN(left), END(left), BEGIN(right), END(right));
112+
return Hash(left.begin(), left.end(), right.begin(), right.end());
113113
}
114114
}
115115

src/test/merkle_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ static uint256 ComputeMerkleRootFromBranch(const uint256& leaf, const std::vecto
1313
uint256 hash = leaf;
1414
for (std::vector<uint256>::const_iterator it = vMerkleBranch.begin(); it != vMerkleBranch.end(); ++it) {
1515
if (nIndex & 1) {
16-
hash = Hash(BEGIN(*it), END(*it), BEGIN(hash), END(hash));
16+
hash = Hash(it->begin(), it->end(), hash.begin(), hash.end());
1717
} else {
18-
hash = Hash(BEGIN(hash), END(hash), BEGIN(*it), END(*it));
18+
hash = Hash(hash.begin(), hash.end(), it->begin(), it->end());
1919
}
2020
nIndex >>= 1;
2121
}

0 commit comments

Comments
 (0)