Changeset View
Changeset View
Standalone View
Standalone View
src/index/blockfilterindex.h
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | public: | ||||
bool LookupFilterRange(int start_height, const CBlockIndex *stop_index, | bool LookupFilterRange(int start_height, const CBlockIndex *stop_index, | ||||
std::vector<BlockFilter> &filters_out) const; | std::vector<BlockFilter> &filters_out) const; | ||||
/** Get a range of filter hashes between two heights on a chain. */ | /** Get a range of filter hashes between two heights on a chain. */ | ||||
bool LookupFilterHashRange(int start_height, const CBlockIndex *stop_index, | bool LookupFilterHashRange(int start_height, const CBlockIndex *stop_index, | ||||
std::vector<uint256> &hashes_out) const; | std::vector<uint256> &hashes_out) const; | ||||
}; | }; | ||||
/** | |||||
* Get a block filter index by type. Returns nullptr if index has not been | |||||
* initialized or was already destroyed. | |||||
*/ | |||||
BlockFilterIndex *GetBlockFilterIndex(BlockFilterType filter_type); | |||||
/** Iterate over all running block filter indexes, invoking fn on each. */ | |||||
void ForEachBlockFilterIndex(std::function<void(BlockFilterIndex &)> fn); | |||||
/** | |||||
* Initialize a block filter index for the given type if one does not already | |||||
* exist. Returns true if a new index is created and false if one has already | |||||
* been initialized. | |||||
*/ | |||||
bool InitBlockFilterIndex(BlockFilterType filter_type, size_t n_cache_size, | |||||
bool f_memory = false, bool f_wipe = false); | |||||
/** | |||||
* Destroy the block filter index with the given type. Returns false if no such | |||||
* index exists. This just releases the allocated memory and closes the database | |||||
* connection, it does not delete the index data. | |||||
*/ | |||||
bool DestroyBlockFilterIndex(BlockFilterType filter_type); | |||||
/** Destroy all open block filter indexes. */ | |||||
void DestroyAllBlockFilterIndexes(); | |||||
#endif // BITCOIN_INDEX_BLOCKFILTERINDEX_H | #endif // BITCOIN_INDEX_BLOCKFILTERINDEX_H |