Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show First 20 Lines • Show All 1,135 Lines • ▼ Show 20 Lines | private: | ||||
bool m_snapshot_validated{false}; | bool m_snapshot_validated{false}; | ||||
//! Internal helper for ActivateSnapshot(). | //! Internal helper for ActivateSnapshot(). | ||||
[[nodiscard]] bool | [[nodiscard]] bool | ||||
PopulateAndValidateSnapshot(CChainState &snapshot_chainstate, | PopulateAndValidateSnapshot(CChainState &snapshot_chainstate, | ||||
CAutoFile &coins_file, | CAutoFile &coins_file, | ||||
const SnapshotMetadata &metadata); | const SnapshotMetadata &metadata); | ||||
// For access to m_active_chainstate. | |||||
friend CChainState &ChainstateActive(); | |||||
friend CChain &ChainActive(); | |||||
public: | public: | ||||
std::thread m_load_block; | std::thread m_load_block; | ||||
//! A single BlockManager instance is shared across each constructed | //! A single BlockManager instance is shared across each constructed | ||||
//! chainstate to avoid duplicating block metadata. | //! chainstate to avoid duplicating block metadata. | ||||
BlockManager m_blockman GUARDED_BY(::cs_main); | BlockManager m_blockman GUARDED_BY(::cs_main); | ||||
//! The total number of bytes available for us to use across all in-memory | //! The total number of bytes available for us to use across all in-memory | ||||
//! coins caches. This will be split somehow across chainstates. | //! coins caches. This will be split somehow across chainstates. | ||||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | public: | ||||
~ChainstateManager() { | ~ChainstateManager() { | ||||
LOCK(::cs_main); | LOCK(::cs_main); | ||||
UnloadBlockIndex(/* mempool */ nullptr, *this); | UnloadBlockIndex(/* mempool */ nullptr, *this); | ||||
Reset(); | Reset(); | ||||
} | } | ||||
}; | }; | ||||
/** | /** | ||||
* DEPRECATED! Please use node.chainman instead. May only be used in | |||||
* validation.cpp internally | |||||
*/ | |||||
extern ChainstateManager g_chainman GUARDED_BY(::cs_main); | |||||
/** Please prefer the identical ChainstateManager::ActiveChainstate */ | |||||
CChainState &ChainstateActive(); | |||||
/** Please prefer the identical ChainstateManager::ActiveChain */ | |||||
CChain &ChainActive(); | |||||
/** | |||||
* 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) | ||||
*/ | */ | ||||
extern std::unique_ptr<CBlockTreeDB> pblocktree; | extern std::unique_ptr<CBlockTreeDB> pblocktree; | ||||
extern VersionBitsCache versionbitscache; | extern VersionBitsCache versionbitscache; | ||||
/** | /** | ||||
* Determine what nVersion a new block should use. | * Determine what nVersion a new block should use. | ||||
Show All 28 Lines |