aboutsummaryrefslogtreecommitdiff
path: root/src/blockfilter.h
diff options
context:
space:
mode:
authorPatrick Strateman <patrick.strateman@gmail.com>2020-06-14 20:14:34 -0400
committerCalvin Kim <calvin@kcalvinalvin.info>2022-05-02 16:04:00 +0900
commitb0a53d50d9142bed51a8372eeb848816bfa94da8 (patch)
treedaa64fb121e1a4d3993bae387fce7be9398417fc /src/blockfilter.h
parent2b5a741e98f186e50d9fbe1ceadcc8b8c91547f7 (diff)
downloadbitcoin-b0a53d50d9142bed51a8372eeb848816bfa94da8.tar.xz
Make sanity check in GCSFilter constructor optional
BlockFilterIndex will perform the cheaper check of verifying the filter hash when reading the filter from disk.
Diffstat (limited to 'src/blockfilter.h')
-rw-r--r--src/blockfilter.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/blockfilter.h b/src/blockfilter.h
index 96cefbf3b2..d6a51e95c2 100644
--- a/src/blockfilter.h
+++ b/src/blockfilter.h
@@ -59,7 +59,7 @@ public:
explicit GCSFilter(const Params& params = Params());
/** Reconstructs an already-created filter from an encoding. */
- GCSFilter(const Params& params, std::vector<unsigned char> encoded_filter);
+ GCSFilter(const Params& params, std::vector<unsigned char> encoded_filter, bool skip_decode_check);
/** Builds a new filter from the params and set of elements. */
GCSFilter(const Params& params, const ElementSet& elements);
@@ -122,7 +122,7 @@ public:
//! Reconstruct a BlockFilter from parts.
BlockFilter(BlockFilterType filter_type, const uint256& block_hash,
- std::vector<unsigned char> filter);
+ std::vector<unsigned char> filter, bool skip_decode_check);
//! Construct a new BlockFilter of the specified type from a block.
BlockFilter(BlockFilterType filter_type, const CBlock& block, const CBlockUndo& block_undo);
@@ -164,7 +164,7 @@ public:
if (!BuildParams(params)) {
throw std::ios_base::failure("unknown filter_type");
}
- m_filter = GCSFilter(params, std::move(encoded_filter));
+ m_filter = GCSFilter(params, std::move(encoded_filter), /*skip_decode_check=*/false);
}
};