LCOV - code coverage report
Current view: top level - src/test/util - blockfilter.cpp (source / functions) Hit Total Coverage
Test: coverage.lcov Lines: 9 13 69.2 %
Date: 2022-04-21 14:51:19 Functions: 1 1 100.0 %
Legend: Modified by patch:
Lines: hit not hit | Branches: + taken - not taken # not executed

Not modified by patch:
Lines: hit not hit | Branches: + taken - not taken # not executed
Branches: 4 6 66.7 %

           Branch data     Line data    Source code
#       1                 :            : // Copyright (c) 2019-2021 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 <test/util/blockfilter.h>
#       6                 :            : 
#       7                 :            : #include <chainparams.h>
#       8                 :            : #include <node/blockstorage.h>
#       9                 :            : #include <validation.h>
#      10                 :            : 
#      11                 :            : using node::ReadBlockFromDisk;
#      12                 :            : using node::UndoReadFromDisk;
#      13                 :            : 
#      14                 :            : bool ComputeFilter(BlockFilterType filter_type, const CBlockIndex* block_index, BlockFilter& filter)
#      15                 :        228 : {
#      16                 :        228 :     LOCK(::cs_main);
#      17                 :            : 
#      18                 :        228 :     CBlock block;
#      19         [ -  + ]:        228 :     if (!ReadBlockFromDisk(block, block_index->GetBlockPos(), Params().GetConsensus())) {
#      20                 :          0 :         return false;
#      21                 :          0 :     }
#      22                 :            : 
#      23                 :        228 :     CBlockUndo block_undo;
#      24 [ +  + ][ -  + ]:        228 :     if (block_index->nHeight > 0 && !UndoReadFromDisk(block_undo, block_index)) {
#      25                 :          0 :         return false;
#      26                 :          0 :     }
#      27                 :            : 
#      28                 :        228 :     filter = BlockFilter(filter_type, block, block_undo);
#      29                 :        228 :     return true;
#      30                 :        228 : }
#      31                 :            : 

Generated by: LCOV version 0-eol-96201-ge66f56f4af6a