diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-07-11 10:50:28 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-07-11 15:39:19 +0200 |
commit | aaaa3323f37526862ebf2a2a4bf522c661e6976e (patch) | |
tree | 672d313344535aa963d2b11935c60a72c771bd5e /src/node | |
parent | 45f757c72672fc351bf669e731744f2f5e269233 (diff) |
refactor: Mark IsBlockPruned const
Member fields are used read-only in this method.
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/blockstorage.cpp | 2 | ||||
-rw-r--r-- | src/node/blockstorage.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index fb62e78138..16d8d25615 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -588,7 +588,7 @@ const CBlockIndex* BlockManager::GetLastCheckpoint(const CCheckpointData& data) return nullptr; } -bool BlockManager::IsBlockPruned(const CBlockIndex& block) +bool BlockManager::IsBlockPruned(const CBlockIndex& block) const { AssertLockHeld(::cs_main); return m_have_pruned && !(block.nStatus & BLOCK_HAVE_DATA) && (block.nTx > 0); diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index 108a08a72b..b4e199af50 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -381,7 +381,7 @@ public: bool m_have_pruned = false; //! 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 void UpdatePruneLock(const std::string& name, const PruneLockInfo& lock_info) EXCLUSIVE_LOCKS_REQUIRED(::cs_main); |