Branch data Line data Source code
1 : : // Copyright (c) 2026-present The Bitcoin Core developers
2 : : // Distributed under the MIT software license, see the accompanying
3 : : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 : :
5 : : #include <node/indexes.h>
6 : :
7 : : #include <index/blockfilterindex.h>
8 : : #include <index/coinstatsindex.h>
9 : : #include <index/txindex.h>
10 : : #include <index/txospenderindex.h>
11 : : #include <node/context.h>
12 : :
13 : : namespace node {
14 : :
15 [ + - ]: 54 : void IndexDeleter::operator()(BlockFilterIndex* index) const noexcept { delete index; }
16 [ + - ]: 49 : void IndexDeleter::operator()(CoinStatsIndex* index) const noexcept { delete index; }
17 [ + - ]: 37 : void IndexDeleter::operator()(TxIndex* index) const noexcept { delete index; }
18 [ + - ]: 22 : void IndexDeleter::operator()(TxoSpenderIndex* index) const noexcept { delete index; }
19 : :
20 : 1523 : BlockFilterIndex* GetBlockFilterIndex(const NodeContext& node, BlockFilterType filter_type)
21 : : {
22 [ + + ]: 1523 : for (const auto& index : node.block_filter_indexes) {
23 [ - + ]: 787 : if (index->GetFilterType() == filter_type) return index.get();
24 : : }
25 : : return nullptr;
26 : : }
27 : :
28 : : } // namespace node
|