aboutsummaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-01-31 19:34:35 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-01-31 19:34:35 +0100
commit87f11ef47fea31d51bcc3f5df68f78fb28e3d8dd (patch)
tree49ce74175b7a0721a246f93ff2b091c390b0ae73 /src/index
parentb5868f4b1f884e8d6612f34ca4005fe3a992053d (diff)
downloadbitcoin-87f11ef47fea31d51bcc3f5df68f78fb28e3d8dd.tar.xz
refactor: use `Hash` helper for double-SHA256 calculations
Diffstat (limited to 'src/index')
-rw-r--r--src/index/blockfilterindex.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/index/blockfilterindex.cpp b/src/index/blockfilterindex.cpp
index 07b4cdc06b..59bf6d34cf 100644
--- a/src/index/blockfilterindex.cpp
+++ b/src/index/blockfilterindex.cpp
@@ -157,9 +157,7 @@ bool BlockFilterIndex::ReadFilterFromDisk(const FlatFilePos& pos, const uint256&
std::vector<uint8_t> encoded_filter;
try {
filein >> block_hash >> encoded_filter;
- uint256 result;
- CHash256().Write(encoded_filter).Finalize(result);
- if (result != hash) return error("Checksum mismatch in filter decode.");
+ if (Hash(encoded_filter) != hash) return error("Checksum mismatch in filter decode.");
filter = BlockFilter(GetFilterType(), block_hash, std::move(encoded_filter), /*skip_decode_check=*/true);
}
catch (const std::exception& e) {