aboutsummaryrefslogtreecommitdiff
path: root/src/index/blockfilterindex.h
diff options
context:
space:
mode:
authorJim Posen <jim.posen@gmail.com>2018-08-30 08:30:23 -0700
committerJim Posen <jim.posen@gmail.com>2019-04-06 12:10:55 -0700
commitaccc8b8b1842ed6d522b71a056777bcac8f39e81 (patch)
treea94aec9035ccd602835e18997f6f19b116f5dc1b /src/index/blockfilterindex.h
parent2bc90e4e7bf7fef56830b33b1fba678fd0dbd6d8 (diff)
downloadbitcoin-accc8b8b1842ed6d522b71a056777bcac8f39e81.tar.xz
index: Access functions for global block filter indexes.
Diffstat (limited to 'src/index/blockfilterindex.h')
-rw-r--r--src/index/blockfilterindex.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/index/blockfilterindex.h b/src/index/blockfilterindex.h
index a689461800..436d52515f 100644
--- a/src/index/blockfilterindex.h
+++ b/src/index/blockfilterindex.h
@@ -65,4 +65,30 @@ public:
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