From aaaa3323f37526862ebf2a2a4bf522c661e6976e Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 11 Jul 2024 10:50:28 +0200 Subject: refactor: Mark IsBlockPruned const Member fields are used read-only in this method. --- src/node/blockstorage.cpp | 2 +- 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); -- cgit v1.2.3