mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01:00
Add ChainstateManager::ActiveChainstate
This commit is contained in:
parent
fabf3d64ff
commit
faba65e696
2 changed files with 7 additions and 6 deletions
|
@ -5251,10 +5251,10 @@ CChainState& ChainstateManager::InitializeChainstate(const uint256& snapshot_blo
|
||||||
return *to_modify;
|
return *to_modify;
|
||||||
}
|
}
|
||||||
|
|
||||||
CChain& ChainstateManager::ActiveChain() const
|
CChainState& ChainstateManager::ActiveChainstate() const
|
||||||
{
|
{
|
||||||
assert(m_active_chainstate);
|
assert(m_active_chainstate);
|
||||||
return m_active_chainstate->m_chain;
|
return *m_active_chainstate;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChainstateManager::IsSnapshotActive() const
|
bool ChainstateManager::IsSnapshotActive() const
|
||||||
|
|
|
@ -799,7 +799,8 @@ public:
|
||||||
std::vector<CChainState*> GetAll();
|
std::vector<CChainState*> GetAll();
|
||||||
|
|
||||||
//! The most-work chain.
|
//! The most-work chain.
|
||||||
CChain& ActiveChain() const;
|
CChainState& ActiveChainstate() const;
|
||||||
|
CChain& ActiveChain() const { return ActiveChainstate().m_chain; }
|
||||||
int ActiveHeight() const { return ActiveChain().Height(); }
|
int ActiveHeight() const { return ActiveChain().Height(); }
|
||||||
CBlockIndex* ActiveTip() const { return ActiveChain().Tip(); }
|
CBlockIndex* ActiveTip() const { return ActiveChain().Tip(); }
|
||||||
|
|
||||||
|
@ -879,13 +880,13 @@ public:
|
||||||
/** DEPRECATED! Please use node.chainman instead. May only be used in validation.cpp internally */
|
/** DEPRECATED! Please use node.chainman instead. May only be used in validation.cpp internally */
|
||||||
extern ChainstateManager g_chainman GUARDED_BY(::cs_main);
|
extern ChainstateManager g_chainman GUARDED_BY(::cs_main);
|
||||||
|
|
||||||
/** @returns the most-work valid chainstate. */
|
/** Please prefer the identical ChainstateManager::ActiveChainstate */
|
||||||
CChainState& ChainstateActive();
|
CChainState& ChainstateActive();
|
||||||
|
|
||||||
/** @returns the most-work chain. */
|
/** Please prefer the identical ChainstateManager::ActiveChain */
|
||||||
CChain& ChainActive();
|
CChain& ChainActive();
|
||||||
|
|
||||||
/** @returns the global block index map. */
|
/** Please prefer the identical ChainstateManager::BlockIndex */
|
||||||
BlockMap& BlockIndex();
|
BlockMap& BlockIndex();
|
||||||
|
|
||||||
/** Global variable that points to the active block tree (protected by cs_main) */
|
/** Global variable that points to the active block tree (protected by cs_main) */
|
||||||
|
|
Loading…
Add table
Reference in a new issue