diff options
author | Jim Posen <jim.posen@gmail.com> | 2018-08-27 18:39:28 -0700 |
---|---|---|
committer | Jim Posen <jim.posen@gmail.com> | 2019-04-06 12:10:22 -0700 |
commit | b5e8200db76f06d35099da502439dcbdfd0a1b3e (patch) | |
tree | 2e549a4f0bbf8ce5ad78faabbe5745f936f89a7f /src/index/blockfilterindex.h | |
parent | 75a76e36199eba228856d59318cb54ca64ca6b57 (diff) | |
download | bitcoin-b5e8200db76f06d35099da502439dcbdfd0a1b3e.tar.xz |
index: Implement lookup methods on block filter index.
Diffstat (limited to 'src/index/blockfilterindex.h')
-rw-r--r-- | src/index/blockfilterindex.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/index/blockfilterindex.h b/src/index/blockfilterindex.h index d2dd3a27bc..a689461800 100644 --- a/src/index/blockfilterindex.h +++ b/src/index/blockfilterindex.h @@ -27,6 +27,7 @@ private: FlatFilePos m_next_filter_pos; std::unique_ptr<FlatFileSeq> m_filter_fileseq; + bool ReadFilterFromDisk(const FlatFilePos& pos, BlockFilter& filter) const; size_t WriteFilterToDisk(FlatFilePos& pos, const BlockFilter& filter); protected: @@ -48,6 +49,20 @@ public: size_t n_cache_size, bool f_memory = false, bool f_wipe = false); BlockFilterType GetFilterType() const { return m_filter_type; } + + /** Get a single filter by block. */ + bool LookupFilter(const CBlockIndex* block_index, BlockFilter& filter_out) const; + + /** Get a single filter header by block. */ + bool LookupFilterHeader(const CBlockIndex* block_index, uint256& header_out) const; + + /** Get a range of filters between two heights on a chain. */ + bool LookupFilterRange(int start_height, const CBlockIndex* stop_index, + std::vector<BlockFilter>& filters_out) const; + + /** Get a range of filter hashes between two heights on a chain. */ + bool LookupFilterHashRange(int start_height, const CBlockIndex* stop_index, + std::vector<uint256>& hashes_out) const; }; #endif // BITCOIN_INDEX_BLOCKFILTERINDEX_H |