[#InitBlockFilterIndex]
= InitBlockFilterIndex
:mrdocs:

Initialize a block filter index for the given type if one does not already exist&period; Returns true if a new index is created and false if one has already been initialized&period;

== Synopsis

Declared in `&lt;index&sol;blockfilterindex&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
InitBlockFilterIndex(
    std::function&lt;std::unique&lowbar;ptr&lt;interfaces::Chain&gt;()&gt; make&lowbar;chain,
    xref:BlockFilterType.adoc[BlockFilterType] filter&lowbar;type,
    size&lowbar;t n&lowbar;cache&lowbar;size,
    bool f&lowbar;memory = false,
    bool f&lowbar;wipe = false);
----

== Return Value

True if a new index was created, false if one already existed&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *make&lowbar;chain*
| Factory that creates a chain interface for the index&period;
| *filter&lowbar;type*
| Filter type of the index to create&period;
| *n&lowbar;cache&lowbar;size*
| Size of the database cache, in bytes&period;
| *f&lowbar;memory*
| Keep the database in memory instead of on disk&period;
| *f&lowbar;wipe*
| Erase any existing database before opening&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
