mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
validation: add CChainParams to ChainstateManager
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user