mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
blockstorage, refactor: make GetFirstStoredBlock() a member of BlockManager
instead of a global
This commit is contained in:
@@ -390,7 +390,8 @@ bool BlockManager::IsBlockPruned(const CBlockIndex* pblockindex)
|
||||
return (m_have_pruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0);
|
||||
}
|
||||
|
||||
const CBlockIndex* GetFirstStoredBlock(const CBlockIndex* start_block) {
|
||||
const CBlockIndex* BlockManager::GetFirstStoredBlock(const CBlockIndex* start_block)
|
||||
{
|
||||
AssertLockHeld(::cs_main);
|
||||
assert(start_block);
|
||||
const CBlockIndex* last_block = start_block;
|
||||
|
||||
@@ -178,6 +178,9 @@ public:
|
||||
//! Returns last CBlockIndex* that is a checkpoint
|
||||
const CBlockIndex* GetLastCheckpoint(const CCheckpointData& data) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
|
||||
//! Find the first block that is not pruned
|
||||
const CBlockIndex* GetFirstStoredBlock(const CBlockIndex* start_block) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||
|
||||
/** True if any block files have ever been pruned. */
|
||||
bool m_have_pruned = false;
|
||||
|
||||
@@ -188,9 +191,6 @@ public:
|
||||
void UpdatePruneLock(const std::string& name, const PruneLockInfo& lock_info) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||
};
|
||||
|
||||
//! Find the first block that is not pruned
|
||||
const CBlockIndex* GetFirstStoredBlock(const CBlockIndex* start_block) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||
|
||||
void CleanupBlockRevFiles();
|
||||
|
||||
/** Open a block file (blk?????.dat) */
|
||||
|
||||
Reference in New Issue
Block a user