mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
validation: add chainman ref to CChainState
Add an upwards reference to chainstate instances to the owning ChainstateManager. This is necessary because there are a number of `this_chainstate == chainman.ActiveChainstate()` checks that will happen (as a result of assumeutxo) in functions that otherwise don't have an easily-accessible reference to the chainstate's ChainManager.
This commit is contained in:
@@ -601,9 +601,15 @@ public:
|
||||
//! CChainState instances.
|
||||
BlockManager& m_blockman;
|
||||
|
||||
//! The chainstate manager that owns this chainstate. The reference is
|
||||
//! necessary so that this instance can check whether it is the active
|
||||
//! chainstate within deeply nested method calls.
|
||||
ChainstateManager& m_chainman;
|
||||
|
||||
explicit CChainState(
|
||||
CTxMemPool* mempool,
|
||||
BlockManager& blockman,
|
||||
ChainstateManager& chainman,
|
||||
std::optional<uint256> from_snapshot_blockhash = std::nullopt);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user