aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-06-03 09:55:58 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-06-19 09:27:00 -0400
commitfaba65e696a88e5626e587f4e63fa15500cbe4d0 (patch)
tree467272d5e303b7ed8c0ce0db94df93bc99b27c7d /src
parentfabf3d64ff2bd14f762810316144bb9fd69c517c (diff)
Add ChainstateManager::ActiveChainstate
Diffstat (limited to 'src')
-rw-r--r--src/validation.cpp4
-rw-r--r--src/validation.h9
2 files changed, 7 insertions, 6 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 8bb03fdb97..fcaa62c9b2 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -5251,10 +5251,10 @@ CChainState& ChainstateManager::InitializeChainstate(const uint256& snapshot_blo
return *to_modify;
}
-CChain& ChainstateManager::ActiveChain() const
+CChainState& ChainstateManager::ActiveChainstate() const
{
assert(m_active_chainstate);
- return m_active_chainstate->m_chain;
+ return *m_active_chainstate;
}
bool ChainstateManager::IsSnapshotActive() const
diff --git a/src/validation.h b/src/validation.h
index e403bcb51a..58383ad923 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -799,7 +799,8 @@ public:
std::vector<CChainState*> GetAll();
//! The most-work chain.
- CChain& ActiveChain() const;
+ CChainState& ActiveChainstate() const;
+ CChain& ActiveChain() const { return ActiveChainstate().m_chain; }
int ActiveHeight() const { return ActiveChain().Height(); }
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 */
extern ChainstateManager g_chainman GUARDED_BY(::cs_main);
-/** @returns the most-work valid chainstate. */
+/** Please prefer the identical ChainstateManager::ActiveChainstate */
CChainState& ChainstateActive();
-/** @returns the most-work chain. */
+/** Please prefer the identical ChainstateManager::ActiveChain */
CChain& ChainActive();
-/** @returns the global block index map. */
+/** Please prefer the identical ChainstateManager::BlockIndex */
BlockMap& BlockIndex();
/** Global variable that points to the active block tree (protected by cs_main) */