MCPcopy Create free account
hub / github.com/ElementsProject/elements / BlockFilterIndex

Method BlockFilterIndex

src/index/blockfilterindex.cpp:96–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94static std::map<BlockFilterType, BlockFilterIndex> g_filter_indexes;
95
96BlockFilterIndex::BlockFilterIndex(BlockFilterType filter_type,
97 size_t n_cache_size, bool f_memory, bool f_wipe)
98 : m_filter_type(filter_type)
99{
100 const std::string& filter_name = BlockFilterTypeName(filter_type);
101 if (filter_name.empty()) throw std::invalid_argument("unknown filter_type");
102
103 fs::path path = gArgs.GetDataDirNet() / "indexes" / "blockfilter" / filter_name;
104 fs::create_directories(path);
105
106 m_name = filter_name + " block filter index";
107 m_db = std::make_unique<BaseIndex::DB>(path / "db", n_cache_size, f_memory, f_wipe);
108 m_filter_fileseq = std::make_unique<FlatFileSeq>(std::move(path), "fltr", FLTR_FILE_CHUNK_SIZE);
109}
110
111bool BlockFilterIndex::Init()
112{

Callers

nothing calls this directly

Calls 2

create_directoriesFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected