MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ComputeFilter

Function ComputeFilter

src/test/util/blockfilter.cpp:15–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13using node::BlockManager;
14
15bool ComputeFilter(BlockFilterType filter_type, const CBlockIndex& block_index, BlockFilter& filter, const BlockManager& blockman)
16{
17 LOCK(::cs_main);
18
19 CBlock block;
20 if (!blockman.ReadBlock(block, block_index)) {
21 return false;
22 }
23
24 CBlockUndo block_undo;
25 if (block_index.nHeight > 0 && !blockman.ReadBlockUndo(block_undo, block_index)) {
26 return false;
27 }
28
29 filter = BlockFilter(filter_type, block, block_undo);
30 return true;
31}

Callers 1

CheckFilterLookupsFunction · 0.85

Calls 3

ReadBlockUndoMethod · 0.80
BlockFilterClass · 0.50
ReadBlockMethod · 0.45

Tested by

no test coverage detected