aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/validation.h b/src/validation.h
index d747fdbf27..6661369bf8 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -505,6 +505,9 @@ public:
CBlockIndex** ppindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
};
+/** Global variable that points to the active CCoinsView (protected by cs_main) */
+extern std::unique_ptr<CCoinsViewCache> pcoinsTip;
+
/**
* CChainState stores and provides an API to update our local knowledge of the
* current best chain.
@@ -566,6 +569,12 @@ public:
*/
std::set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexCandidates;
+ //! @returns A reference to the in-memory cache of the UTXO set.
+ CCoinsViewCache& CoinsTip()
+ {
+ return *::pcoinsTip;
+ }
+
/**
* Update the on-disk chain state.
* The caches and indexes are flushed depending on the mode we're called with
@@ -662,9 +671,6 @@ BlockMap& BlockIndex();
/** Global variable that points to the coins database (protected by cs_main) */
extern std::unique_ptr<CCoinsViewDB> pcoinsdbview;
-/** Global variable that points to the active CCoinsView (protected by cs_main) */
-extern std::unique_ptr<CCoinsViewCache> pcoinsTip;
-
/** Global variable that points to the active block tree (protected by cs_main) */
extern std::unique_ptr<CBlockTreeDB> pblocktree;