LCOV - code coverage report
Current view: top level - src/node - indexes.cpp (source / functions) Coverage Total Hit
Test: total_coverage.info Lines: 100.0 % 7 7
Test Date: 2026-11-27 06:15:43 Functions: 100.0 % 5 5
Branches: 58.3 % 12 7

             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
        

Generated by: LCOV version 2.0-1