Do not pass Consensus::Params& to Chainstate helpers

This commit is contained in:
MacroFake
2022-05-18 18:49:36 +02:00
parent fa4ee53dca
commit faf012b438
5 changed files with 3 additions and 13 deletions

View File

@@ -13,7 +13,6 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
ChainstateManager& chainman,
CTxMemPool* mempool,
bool fPruneMode,
const Consensus::Params& consensus_params,
bool fReindexChainState,
int64_t nBlockTreeDBCache,
int64_t nCoinDBCache,
@@ -57,7 +56,7 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
}
if (!chainman.BlockIndex().empty() &&
!chainman.m_blockman.LookupBlockIndex(consensus_params.hashGenesisBlock)) {
!chainman.m_blockman.LookupBlockIndex(chainman.GetConsensus().hashGenesisBlock)) {
return ChainstateLoadingError::ERROR_BAD_GENESIS_BLOCK;
}
@@ -126,7 +125,6 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManager& chainman,
bool fReset,
bool fReindexChainState,
const Consensus::Params& consensus_params,
int check_blocks,
int check_level)
{
@@ -144,7 +142,7 @@ std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManage
}
if (!CVerifyDB().VerifyDB(
*chainstate, consensus_params, chainstate->CoinsDB(),
*chainstate, chainman.GetConsensus(), chainstate->CoinsDB(),
check_level,
check_blocks)) {
return ChainstateLoadVerifyError::ERROR_CORRUPTED_BLOCK_DB;