mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
validation: VerifyDB only needs Consensus::Params
Previously we were passing in CChainParams, when VerifyDB only needed the Consensus::Params subset.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <node/chainstate.h>
|
||||
|
||||
#include <chainparams.h> // for CChainParams
|
||||
#include <consensus/params.h> // for Consensus::Params
|
||||
#include <node/blockstorage.h> // for CleanupBlockRevFiles, fHavePruned, fReindex
|
||||
#include <validation.h> // for a lot of things
|
||||
|
||||
@@ -12,7 +12,7 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
|
||||
ChainstateManager& chainman,
|
||||
CTxMemPool* mempool,
|
||||
bool fPruneMode,
|
||||
const CChainParams& chainparams,
|
||||
const Consensus::Params& consensus_params,
|
||||
bool fReindexChainState,
|
||||
int64_t nBlockTreeDBCache,
|
||||
int64_t nCoinDBCache,
|
||||
@@ -57,7 +57,7 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
|
||||
}
|
||||
|
||||
if (!chainman.BlockIndex().empty() &&
|
||||
!chainman.m_blockman.LookupBlockIndex(chainparams.GetConsensus().hashGenesisBlock)) {
|
||||
!chainman.m_blockman.LookupBlockIndex(consensus_params.hashGenesisBlock)) {
|
||||
return ChainstateLoadingError::ERROR_BAD_GENESIS_BLOCK;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
|
||||
std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManager& chainman,
|
||||
bool fReset,
|
||||
bool fReindexChainState,
|
||||
const CChainParams& chainparams,
|
||||
const Consensus::Params& consensus_params,
|
||||
unsigned int check_blocks,
|
||||
unsigned int check_level,
|
||||
std::function<int64_t()> get_unix_time_seconds)
|
||||
@@ -148,7 +148,7 @@ std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManage
|
||||
}
|
||||
|
||||
if (!CVerifyDB().VerifyDB(
|
||||
*chainstate, chainparams, chainstate->CoinsDB(),
|
||||
*chainstate, consensus_params, chainstate->CoinsDB(),
|
||||
check_level,
|
||||
check_blocks)) {
|
||||
return ChainstateLoadVerifyError::ERROR_CORRUPTED_BLOCK_DB;
|
||||
|
||||
Reference in New Issue
Block a user