@@ -94,9 +94,9 @@ struct DBHashKey {
9494
9595static std::map<BlockFilterType, BlockFilterIndex> g_filter_indexes;
9696
97- BlockFilterIndex::BlockFilterIndex (BlockFilterType filter_type,
97+ BlockFilterIndex::BlockFilterIndex (std::unique_ptr<interfaces::Chain> chain, BlockFilterType filter_type,
9898 size_t n_cache_size, bool f_memory, bool f_wipe)
99- : m_filter_type(filter_type)
99+ : BaseIndex(std::move(chain)), m_filter_type(filter_type)
100100{
101101 const std::string& filter_name = BlockFilterTypeName (filter_type);
102102 if (filter_name.empty ()) throw std::invalid_argument (" unknown filter_type" );
@@ -467,12 +467,12 @@ void ForEachBlockFilterIndex(std::function<void (BlockFilterIndex&)> fn)
467467 for (auto & entry : g_filter_indexes) fn (entry.second );
468468}
469469
470- bool InitBlockFilterIndex (BlockFilterType filter_type,
470+ bool InitBlockFilterIndex (std::function<std::unique_ptr<interfaces::Chain>()> make_chain, BlockFilterType filter_type,
471471 size_t n_cache_size, bool f_memory, bool f_wipe)
472472{
473473 auto result = g_filter_indexes.emplace (std::piecewise_construct,
474474 std::forward_as_tuple (filter_type),
475- std::forward_as_tuple (filter_type,
475+ std::forward_as_tuple (make_chain (), filter_type,
476476 n_cache_size, f_memory, f_wipe));
477477 return result.second ;
478478}
0 commit comments