diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-02-18 15:49:41 +0100 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-05-10 19:06:53 +0200 |
commit | f0bb1021f0d60f5f19176e67a66fcf7c325f88d1 (patch) | |
tree | 042a49839ae28506b5de80a32895ddf6812264bb /src/index/blockfilterindex.cpp | |
parent | cfbb2124939822e95265a39242ffca3d86bac6e8 (diff) | |
download | bitcoin-f0bb1021f0d60f5f19176e67a66fcf7c325f88d1.tar.xz |
refactor: Move functions to BlockManager methods
This is a commit in preparation for the next few commits. The functions
are moved to methods to avoid their re-declaration for the purpose of
passing in BlockManager options.
The functions that were now moved into the BlockManager should no longer
use the params as an argument, but instead use the member variable.
In the moved ReadBlockFromDisk and UndoReadFromDisk, change
the function signature to accept a reference to a CBlockIndex instead of
a raw pointer. The pointer is expected to be non-null, so reflect that
in the type.
To allow for the move of functions to BlockManager methods all call
sites require an instantiated BlockManager, or a callback to one.
Diffstat (limited to 'src/index/blockfilterindex.cpp')
-rw-r--r-- | src/index/blockfilterindex.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/index/blockfilterindex.cpp b/src/index/blockfilterindex.cpp index e6300ce3dd..a860b3a94d 100644 --- a/src/index/blockfilterindex.cpp +++ b/src/index/blockfilterindex.cpp @@ -12,8 +12,6 @@ #include <util/fs_helpers.h> #include <validation.h> -using node::UndoReadFromDisk; - /* The index database stores three items for each block: the disk location of the encoded filter, * its dSHA256 hash, and the header. Those belonging to blocks on the active chain are indexed by * height, and those belonging to blocks that have been reorganized out of the active chain are @@ -223,7 +221,7 @@ bool BlockFilterIndex::CustomAppend(const interfaces::BlockInfo& block) // pindex variable gives indexing code access to node internals. It // will be removed in upcoming commit const CBlockIndex* pindex = WITH_LOCK(cs_main, return m_chainstate->m_blockman.LookupBlockIndex(block.hash)); - if (!UndoReadFromDisk(block_undo, pindex)) { + if (!m_chainstate->m_blockman.UndoReadFromDisk(block_undo, *pindex)) { return false; } |