mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-26 11:21:19 +02:00
refactor: Mark IsBlockPruned const
Member fields are used read-only in this method.
This commit is contained in:
@@ -588,7 +588,7 @@ const CBlockIndex* BlockManager::GetLastCheckpoint(const CCheckpointData& data)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlockManager::IsBlockPruned(const CBlockIndex& block)
|
bool BlockManager::IsBlockPruned(const CBlockIndex& block) const
|
||||||
{
|
{
|
||||||
AssertLockHeld(::cs_main);
|
AssertLockHeld(::cs_main);
|
||||||
return m_have_pruned && !(block.nStatus & BLOCK_HAVE_DATA) && (block.nTx > 0);
|
return m_have_pruned && !(block.nStatus & BLOCK_HAVE_DATA) && (block.nTx > 0);
|
||||||
|
@@ -381,7 +381,7 @@ public:
|
|||||||
bool m_have_pruned = false;
|
bool m_have_pruned = false;
|
||||||
|
|
||||||
//! Check whether the block associated with this index entry is pruned or not.
|
//! Check whether the block associated with this index entry is pruned or not.
|
||||||
bool IsBlockPruned(const CBlockIndex& block) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
bool IsBlockPruned(const CBlockIndex& block) const EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||||
|
|
||||||
//! Create or update a prune lock identified by its name
|
//! Create or update a prune lock identified by its name
|
||||||
void UpdatePruneLock(const std::string& name, const PruneLockInfo& lock_info) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
void UpdatePruneLock(const std::string& name, const PruneLockInfo& lock_info) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||||
|
Reference in New Issue
Block a user