5 #ifndef BITCOIN_INDEX_BLOCKFILTERINDEX_H 6 #define BITCOIN_INDEX_BLOCKFILTERINDEX_H 33 std::unique_ptr<BaseIndex::DB>
m_db;
43 std::unordered_map<uint256, uint256, FilterHeaderHasher> m_headers_cache
GUARDED_BY(m_cs_headers_cache);
48 bool CommitInternal(
CDBBatch& batch)
override;
56 const char*
GetName()
const override {
return m_name.c_str(); }
61 size_t n_cache_size,
bool f_memory =
false,
bool f_wipe =
false);
72 bool LookupFilterRange(
int start_height,
const CBlockIndex* stop_index,
73 std::vector<BlockFilter>& filters_out)
const;
76 bool LookupFilterHashRange(
int start_height,
const CBlockIndex* stop_index,
77 std::vector<uint256>& hashes_out)
const;
94 size_t n_cache_size,
bool f_memory =
false,
bool f_wipe =
false);
106 #endif // BITCOIN_INDEX_BLOCKFILTERINDEX_H BlockFilterIndex is used to store and retrieve block filters, hashes, and headers for a range of bloc...
Batch of changes queued to be written to a CDBWrapper.
void ForEachBlockFilterIndex(std::function< void(BlockFilterIndex &)> fn)
Iterate over all running block filter indexes, invoking fn on each.
const char * GetName() const override
Get the name of the index for display in logs.
std::unique_ptr< BaseIndex::DB > m_db
BaseIndex::DB & GetDB() const override
The database stores a block locator of the chain the database is synced to so that the index can effi...
Base class for indices of blockchain data.
BlockFilterIndex * GetBlockFilterIndex(BlockFilterType filter_type)
Get a block filter index by type.
Complete block filter struct as defined in BIP 157.
void DestroyAllBlockFilterIndexes()
Destroy all open block filter indexes.
BlockFilterType GetFilterType() const
BlockFilterType m_filter_type
static constexpr int CFCHECKPT_INTERVAL
Interval between compact filter checkpoints.
bool InitBlockFilterIndex(BlockFilterType filter_type, size_t n_cache_size, bool f_memory=false, bool f_wipe=false)
Initialize a block filter index for the given type if one does not already exist. ...
The block chain is a tree shaped structure starting with the genesis block at the root...
FlatFilePos m_next_filter_pos
bool DestroyBlockFilterIndex(BlockFilterType filter_type)
Destroy the block filter index with the given type.
static uint64_t ReadLE64(const unsigned char *ptr)
std::unique_ptr< FlatFileSeq > m_filter_fileseq