diff options
author | James O'Beirne <james.obeirne@gmail.com> | 2019-07-24 11:45:04 -0400 |
---|---|---|
committer | James O'Beirne <james.obeirne@gmail.com> | 2019-08-06 13:13:06 -0400 |
commit | fae6ab6aed3b9fdc9201bb19a307dfc3d9b89891 (patch) | |
tree | 32136f410bdb26e8c414caddf9e3c86dbf45a8db /src/validation.h | |
parent | e5fdda68c6d2313edb74443f0d1e6d2ce2d97f5e (diff) | |
download | bitcoin-fae6ab6aed3b9fdc9201bb19a307dfc3d9b89891.tar.xz |
refactor: pcoinsTip -> CChainState::CoinsTip()
This aliasing makes subsequent commits easier to review; eventually CoinsTip()
will return the CCoinsViewCache managed by CChainState.
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 12 |
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; |