mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-25 22:39:13 +02:00
refactor: use Hash helper for double-SHA256 calculations
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user