diff options
author | Jon Atack <jon@atack.com> | 2022-04-27 12:21:22 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-04-28 20:42:08 +0200 |
commit | ed12c0a49d3c64d170aca9e66ef32a57d7933eeb (patch) | |
tree | 6f74d670d7c39c3cdd4531e48156f5e3fc6757a6 /src/rpc/blockchain.cpp | |
parent | dabec990135cc32584e822126ec49f8b31350837 (diff) | |
download | bitcoin-ed12c0a49d3c64d170aca9e66ef32a57d7933eeb.tar.xz |
blockstorage, refactor: make GetFirstStoredBlock() a member of BlockManager
instead of a global
Diffstat (limited to 'src/rpc/blockchain.cpp')
-rw-r--r-- | src/rpc/blockchain.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 96e9efb288..6347036b9a 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -787,7 +787,7 @@ static RPCHelpMan pruneblockchain() PruneBlockFilesManual(active_chainstate, height); const CBlockIndex* block = CHECK_NONFATAL(active_chain.Tip()); - const CBlockIndex* last_block = node::GetFirstStoredBlock(block); + const CBlockIndex* last_block{active_chainstate.m_blockman.GetFirstStoredBlock(block)}; return static_cast<uint64_t>(last_block->nHeight); }, @@ -1215,7 +1215,7 @@ RPCHelpMan getblockchaininfo() obj.pushKV("size_on_disk", chainman.m_blockman.CalculateCurrentUsage()); obj.pushKV("pruned", node::fPruneMode); if (node::fPruneMode) { - obj.pushKV("pruneheight", node::GetFirstStoredBlock(&tip)->nHeight); + obj.pushKV("pruneheight", chainman.m_blockman.GetFirstStoredBlock(&tip)->nHeight); // if 0, execution bypasses the whole if block. bool automatic_pruning{args.GetIntArg("-prune", 0) != 1}; |