mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
refactor: validation: mark SnapshotBase as const
It does not modify any logical state. This change is required for future const-correctness commits.
This commit is contained in:
parent
f409444d02
commit
d05481df64
2 changed files with 3 additions and 3 deletions
|
@ -1970,7 +1970,7 @@ Chainstate::Chainstate(
|
|||
m_chainman(chainman),
|
||||
m_from_snapshot_blockhash(from_snapshot_blockhash) {}
|
||||
|
||||
const CBlockIndex* Chainstate::SnapshotBase()
|
||||
const CBlockIndex* Chainstate::SnapshotBase() const
|
||||
{
|
||||
if (!m_from_snapshot_blockhash) return nullptr;
|
||||
if (!m_cached_snapshot_base) m_cached_snapshot_base = Assert(m_chainman.m_blockman.LookupBlockIndex(*m_from_snapshot_blockhash));
|
||||
|
|
|
@ -532,7 +532,7 @@ protected:
|
|||
bool m_disabled GUARDED_BY(::cs_main) {false};
|
||||
|
||||
//! Cached result of LookupBlockIndex(*m_from_snapshot_blockhash)
|
||||
const CBlockIndex* m_cached_snapshot_base GUARDED_BY(::cs_main) {nullptr};
|
||||
mutable const CBlockIndex* m_cached_snapshot_base GUARDED_BY(::cs_main){nullptr};
|
||||
|
||||
public:
|
||||
//! Reference to a BlockManager instance which itself is shared across all
|
||||
|
@ -596,7 +596,7 @@ public:
|
|||
*
|
||||
* nullptr if this chainstate was not created from a snapshot.
|
||||
*/
|
||||
const CBlockIndex* SnapshotBase() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||
const CBlockIndex* SnapshotBase() const EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||
|
||||
/**
|
||||
* The set of all CBlockIndex entries that have as much work as our current
|
||||
|
|
Loading…
Add table
Reference in a new issue