diff options
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/validation.h b/src/validation.h index 7f5039aaea..9ba206855f 100644 --- a/src/validation.h +++ b/src/validation.h @@ -43,7 +43,7 @@ #include <utility> #include <vector> -class CChainState; +class Chainstate; class CBlockTreeDB; class CTxMemPool; class ChainstateManager; @@ -127,7 +127,7 @@ bool AbortNode(BlockValidationState& state, const std::string& strMessage, const double GuessVerificationProgress(const ChainTxData& data, const CBlockIndex* pindex); /** Prune block files up to a given height */ -void PruneBlockFilesManual(CChainState& active_chainstate, int nManualPruneHeight); +void PruneBlockFilesManual(Chainstate& active_chainstate, int nManualPruneHeight); /** * Validation result for a single transaction mempool acceptance. @@ -240,7 +240,7 @@ struct PackageMempoolAcceptResult * * @returns a MempoolAcceptResult indicating whether the transaction was accepted/rejected with reason. */ -MempoolAcceptResult AcceptToMemoryPool(CChainState& active_chainstate, const CTransactionRef& tx, +MempoolAcceptResult AcceptToMemoryPool(Chainstate& active_chainstate, const CTransactionRef& tx, int64_t accept_time, bool bypass_limits, bool test_accept) EXCLUSIVE_LOCKS_REQUIRED(cs_main); @@ -252,7 +252,7 @@ MempoolAcceptResult AcceptToMemoryPool(CChainState& active_chainstate, const CTr * If a transaction fails, validation will exit early and some results may be missing. It is also * possible for the package to be partially submitted. */ -PackageMempoolAcceptResult ProcessNewPackage(CChainState& active_chainstate, CTxMemPool& pool, +PackageMempoolAcceptResult ProcessNewPackage(Chainstate& active_chainstate, CTxMemPool& pool, const Package& txns, bool test_accept) EXCLUSIVE_LOCKS_REQUIRED(cs_main); @@ -333,7 +333,7 @@ bool CheckBlock(const CBlock& block, BlockValidationState& state, const Consensu /** Check a block is completely valid from start to finish (only works on top of our current best block) */ bool TestBlockValidity(BlockValidationState& state, const CChainParams& chainparams, - CChainState& chainstate, + Chainstate& chainstate, const CBlock& block, CBlockIndex* pindexPrev, const std::function<NodeClock::time_point()>& adjusted_time_callback, @@ -352,7 +352,7 @@ public: CVerifyDB(); ~CVerifyDB(); bool VerifyDB( - CChainState& chainstate, + Chainstate& chainstate, const Consensus::Params& consensus_params, CCoinsView& coinsview, int nCheckLevel, @@ -368,7 +368,7 @@ enum DisconnectResult class ConnectTrace; -/** @see CChainState::FlushStateToDisk */ +/** @see Chainstate::FlushStateToDisk */ enum class FlushStateMode { NONE, IF_NEEDED, @@ -421,7 +421,7 @@ enum class CoinsCacheSizeState }; /** - * CChainState stores and provides an API to update our local knowledge of the + * Chainstate stores and provides an API to update our local knowledge of the * current best chain. * * Eventually, the API here is targeted at being exposed externally as a @@ -434,7 +434,7 @@ enum class CoinsCacheSizeState * whereas block information and metadata independent of the current tip is * kept in `BlockManager`. */ -class CChainState +class Chainstate { protected: /** @@ -472,7 +472,7 @@ protected: public: //! Reference to a BlockManager instance which itself is shared across all - //! CChainState instances. + //! Chainstate instances. node::BlockManager& m_blockman; /** Chain parameters for this chainstate */ @@ -484,7 +484,7 @@ public: //! chainstate within deeply nested method calls. ChainstateManager& m_chainman; - explicit CChainState( + explicit Chainstate( CTxMemPool* mempool, node::BlockManager& blockman, ChainstateManager& chainman, @@ -814,7 +814,7 @@ private: //! This is especially important when, e.g., calling ActivateBestChain() //! on all chainstates because we are not able to hold ::cs_main going into //! that call. - std::unique_ptr<CChainState> m_ibd_chainstate GUARDED_BY(::cs_main); + std::unique_ptr<Chainstate> m_ibd_chainstate GUARDED_BY(::cs_main); //! A chainstate initialized on the basis of a UTXO snapshot. If this is //! non-null, it is always our active chainstate. @@ -825,7 +825,7 @@ private: //! This is especially important when, e.g., calling ActivateBestChain() //! on all chainstates because we are not able to hold ::cs_main going into //! that call. - std::unique_ptr<CChainState> m_snapshot_chainstate GUARDED_BY(::cs_main); + std::unique_ptr<Chainstate> m_snapshot_chainstate GUARDED_BY(::cs_main); //! Points to either the ibd or snapshot chainstate; indicates our //! most-work chain. @@ -836,7 +836,7 @@ private: //! This is especially important when, e.g., calling ActivateBestChain() //! on all chainstates because we are not able to hold ::cs_main going into //! that call. - CChainState* m_active_chainstate GUARDED_BY(::cs_main) {nullptr}; + Chainstate* m_active_chainstate GUARDED_BY(::cs_main) {nullptr}; //! If true, the assumed-valid chainstate has been fully validated //! by the background validation chainstate. @@ -846,7 +846,7 @@ private: //! Internal helper for ActivateSnapshot(). [[nodiscard]] bool PopulateAndValidateSnapshot( - CChainState& snapshot_chainstate, + Chainstate& snapshot_chainstate, AutoFile& coins_file, const node::SnapshotMetadata& metadata); @@ -862,7 +862,7 @@ private: BlockValidationState& state, CBlockIndex** ppindex, bool min_pow_checked) EXCLUSIVE_LOCKS_REQUIRED(cs_main); - friend CChainState; + friend Chainstate; /** Most recent headers presync progress update, for rate-limiting. */ std::chrono::time_point<std::chrono::steady_clock> m_last_presync_update GUARDED_BY(::cs_main) {}; @@ -936,19 +936,19 @@ public: // constructor //! @param[in] snapshot_blockhash If given, signify that this chainstate //! is based on a snapshot. - CChainState& InitializeChainstate( + Chainstate& InitializeChainstate( CTxMemPool* mempool, const std::optional<uint256>& snapshot_blockhash = std::nullopt) LIFETIMEBOUND EXCLUSIVE_LOCKS_REQUIRED(::cs_main); //! Get all chainstates currently being used. - std::vector<CChainState*> GetAll(); + std::vector<Chainstate*> GetAll(); //! Construct and activate a Chainstate on the basis of UTXO snapshot data. //! //! Steps: //! - //! - Initialize an unused CChainState. + //! - Initialize an unused Chainstate. //! - Load its `CoinsViews` contents from `coins_file`. //! - Verify that the hash of the resulting coinsdb matches the expected hash //! per assumeutxo chain parameters. @@ -961,7 +961,7 @@ public: AutoFile& coins_file, const node::SnapshotMetadata& metadata, bool in_memory); //! The most-work chain. - CChainState& ActiveChainstate() const; + Chainstate& ActiveChainstate() const; CChain& ActiveChain() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) { return ActiveChainstate().m_chain; } int ActiveHeight() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) { return ActiveChain().Height(); } CBlockIndex* ActiveTip() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex()) { return ActiveChain().Tip(); } |