diff options
author | James O'Beirne <james.obeirne@pm.me> | 2021-06-12 10:52:40 -0400 |
---|---|---|
committer | James O'Beirne <james.obeirne@pm.me> | 2021-07-16 12:45:20 -0400 |
commit | 9f6bb539359b98d5b39482ab8a28a68608f0c645 (patch) | |
tree | 4397f65cb333ecc102ed1d36057d4a5ba8983af4 /src/validation.h | |
parent | d86e6625e8571ecff7a13bf2826436859c7ae698 (diff) |
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.
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/validation.h b/src/validation.h index 9a2be3ad97..b024699fe8 100644 --- a/src/validation.h +++ b/src/validation.h @@ -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); /** |