Skip to content

Commit aaaa332

Browse files
author
MarcoFalke
committed
refactor: Mark IsBlockPruned const
Member fields are used read-only in this method.
1 parent 45f757c commit aaaa332

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/node/blockstorage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ const CBlockIndex* BlockManager::GetLastCheckpoint(const CCheckpointData& data)
588588
return nullptr;
589589
}
590590

591-
bool BlockManager::IsBlockPruned(const CBlockIndex& block)
591+
bool BlockManager::IsBlockPruned(const CBlockIndex& block) const
592592
{
593593
AssertLockHeld(::cs_main);
594594
return m_have_pruned && !(block.nStatus & BLOCK_HAVE_DATA) && (block.nTx > 0);

src/node/blockstorage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ class BlockManager
381381
bool m_have_pruned = false;
382382

383383
//! Check whether the block associated with this index entry is pruned or not.
384-
bool IsBlockPruned(const CBlockIndex& block) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
384+
bool IsBlockPruned(const CBlockIndex& block) const EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
385385

386386
//! Create or update a prune lock identified by its name
387387
void UpdatePruneLock(const std::string& name, const PruneLockInfo& lock_info) EXCLUSIVE_LOCKS_REQUIRED(::cs_main);

0 commit comments

Comments
 (0)