diff options
author | Anthony Towns <aj@erisian.com.au> | 2022-01-18 21:34:16 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2022-05-10 12:09:27 +1000 |
commit | 69675ea4e73dcf5e9dd0f94802bd3463e4262081 (patch) | |
tree | fd28492424413d54e5e84f75d3118529b0b82071 /src/validation.h | |
parent | a8098f2cef53ec003edae91100afce564e9c6f23 (diff) |
validation: add CChainParams to ChainstateManager
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/validation.h b/src/validation.h index 42e41502f9..1852ae6a54 100644 --- a/src/validation.h +++ b/src/validation.h @@ -13,6 +13,7 @@ #include <arith_uint256.h> #include <attributes.h> #include <chain.h> +#include <chainparams.h> #include <consensus/amount.h> #include <fs.h> #include <node/blockstorage.h> @@ -51,6 +52,9 @@ struct AssumeutxoData; namespace node { class SnapshotMetadata; } // namespace node +namespace Consensus { +struct Params; +} // namespace Consensus /** Default for -minrelaytxfee, minimum relay fee for transactions */ static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000; @@ -834,6 +838,8 @@ private: CBlockIndex* m_best_invalid GUARDED_BY(::cs_main){nullptr}; + const CChainParams& m_chainparams; + //! Internal helper for ActivateSnapshot(). [[nodiscard]] bool PopulateAndValidateSnapshot( CChainState& snapshot_chainstate, @@ -852,6 +858,11 @@ private: friend CChainState; public: + explicit ChainstateManager(const CChainParams& chainparams) : m_chainparams{chainparams} { } + + const CChainParams& GetParams() const { return m_chainparams; } + const Consensus::Params& GetConsensus() const { return m_chainparams.GetConsensus(); } + std::thread m_load_block; //! A single BlockManager instance is shared across each constructed //! chainstate to avoid duplicating block metadata. |