diff options
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/validation.h b/src/validation.h index 1b80d0ccf4..70b6c072e6 100644 --- a/src/validation.h +++ b/src/validation.h @@ -14,6 +14,7 @@ #include <attributes.h> #include <chain.h> #include <chainparams.h> +#include <kernel/chainstatemanager_opts.h> #include <consensus/amount.h> #include <deploymentstatus.h> #include <fs.h> @@ -57,8 +58,6 @@ namespace Consensus { struct Params; } // namespace Consensus -/** Default for -minrelaytxfee, minimum relay fee for transactions */ -static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000; /** Default for -limitancestorcount, max number of in-mempool ancestors */ static const unsigned int DEFAULT_ANCESTOR_LIMIT = 25; /** Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors */ @@ -125,8 +124,6 @@ extern bool g_parallel_script_checks; extern bool fRequireStandard; extern bool fCheckBlockIndex; extern bool fCheckpointsEnabled; -/** A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation) */ -extern CFeeRate minRelayTxFee; /** If the tip is older than this (in seconds), the node is considered to be in initial block download. */ extern int64_t nMaxTipAge; @@ -361,6 +358,7 @@ bool TestBlockValidity(BlockValidationState& state, CChainState& chainstate, const CBlock& block, CBlockIndex* pindexPrev, + const std::function<int64_t()>& adjusted_time_callback, bool fCheckPOW = true, bool fCheckMerkleRoot = true) EXCLUSIVE_LOCKS_REQUIRED(cs_main); @@ -834,7 +832,9 @@ private: CBlockIndex* m_best_invalid GUARDED_BY(::cs_main){nullptr}; - const CChainParams& m_chainparams; + const CChainParams m_chainparams; + + const std::function<int64_t()> m_adjusted_time_callback; //! Internal helper for ActivateSnapshot(). [[nodiscard]] bool PopulateAndValidateSnapshot( @@ -853,7 +853,11 @@ private: friend CChainState; public: - explicit ChainstateManager(const CChainParams& chainparams) : m_chainparams{chainparams} { } + using Options = ChainstateManagerOpts; + + explicit ChainstateManager(const Options& opts) + : m_chainparams{opts.chainparams}, + m_adjusted_time_callback{Assert(opts.adjusted_time_callback)} {}; const CChainParams& GetParams() const { return m_chainparams; } const Consensus::Params& GetConsensus() const { return m_chainparams.GetConsensus(); } |