mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
refactor: pcoinsTip -> CChainState::CoinsTip()
This aliasing makes subsequent commits easier to review; eventually CoinsTip() will return the CCoinsViewCache managed by CChainState.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user