diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2023-01-31 19:34:35 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2023-01-31 19:34:35 +0100 |
commit | 87f11ef47fea31d51bcc3f5df68f78fb28e3d8dd (patch) | |
tree | 49ce74175b7a0721a246f93ff2b091c390b0ae73 /src/test/merkle_tests.cpp | |
parent | b5868f4b1f884e8d6612f34ca4005fe3a992053d (diff) |
refactor: use `Hash` helper for double-SHA256 calculations
Diffstat (limited to 'src/test/merkle_tests.cpp')
-rw-r--r-- | src/test/merkle_tests.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/merkle_tests.cpp b/src/test/merkle_tests.cpp index bba103d1b0..74e01fc2a5 100644 --- a/src/test/merkle_tests.cpp +++ b/src/test/merkle_tests.cpp @@ -60,7 +60,7 @@ static void MerkleComputation(const std::vector<uint256>& leaves, uint256* proot } } mutated |= (inner[level] == h); - CHash256().Write(inner[level]).Write(h).Finalize(h); + h = Hash(inner[level], h); } // Store the resulting hash at inner position level. inner[level] = h; @@ -86,7 +86,7 @@ static void MerkleComputation(const std::vector<uint256>& leaves, uint256* proot if (pbranch && matchh) { pbranch->push_back(h); } - CHash256().Write(h).Write(h).Finalize(h); + h = Hash(h, h); // Increment count to the value it would have if two entries at this // level had existed. count += ((uint32_t{1}) << level); @@ -101,7 +101,7 @@ static void MerkleComputation(const std::vector<uint256>& leaves, uint256* proot matchh = true; } } - CHash256().Write(inner[level]).Write(h).Finalize(h); + h = Hash(inner[level], h); level++; } } |