| 94 | static std::map<BlockFilterType, BlockFilterIndex> g_filter_indexes; |
| 95 | |
| 96 | BlockFilterIndex::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 | |
| 111 | bool BlockFilterIndex::Init() |
| 112 | { |
nothing calls this directly
no test coverage detected