mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-16 02:24:58 +01:00
blockstorage, refactor: make GetFirstStoredBlock() a member of BlockManager
instead of a global
This commit is contained in:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user