From fa0d9211ef87a682573aaae932c0c440acbcb8a8 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 27 Apr 2021 22:54:53 +0200 Subject: refactor: Remove chainparams arg from CChainState member functions Passing this is confusing and redundant with the m_params member. --- src/node/blockstorage.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/node/blockstorage.cpp') diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 013d61282b..0083b74b33 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -493,7 +493,6 @@ struct CImportingNow { void ThreadImport(ChainstateManager& chainman, std::vector vImportFiles, const ArgsManager& args) { - const CChainParams& chainparams = Params(); ScheduleBatchPriority(); { @@ -512,7 +511,7 @@ void ThreadImport(ChainstateManager& chainman, std::vector vImportFile break; // This error is logged in OpenBlockFile } LogPrintf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile); - chainman.ActiveChainstate().LoadExternalBlockFile(chainparams, file, &pos); + chainman.ActiveChainstate().LoadExternalBlockFile(file, &pos); if (ShutdownRequested()) { LogPrintf("Shutdown requested. Exit %s\n", __func__); return; @@ -523,7 +522,7 @@ void ThreadImport(ChainstateManager& chainman, std::vector vImportFile fReindex = false; LogPrintf("Reindexing finished\n"); // To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked): - chainman.ActiveChainstate().LoadGenesisBlock(chainparams); + chainman.ActiveChainstate().LoadGenesisBlock(); } // -loadblock= @@ -531,7 +530,7 @@ void ThreadImport(ChainstateManager& chainman, std::vector vImportFile FILE* file = fsbridge::fopen(path, "rb"); if (file) { LogPrintf("Importing blocks file %s...\n", path.string()); - chainman.ActiveChainstate().LoadExternalBlockFile(chainparams, file); + chainman.ActiveChainstate().LoadExternalBlockFile(file); if (ShutdownRequested()) { LogPrintf("Shutdown requested. Exit %s\n", __func__); return; @@ -548,7 +547,7 @@ void ThreadImport(ChainstateManager& chainman, std::vector vImportFile // the relevant pointers before the ABC call. for (CChainState* chainstate : WITH_LOCK(::cs_main, return chainman.GetAll())) { BlockValidationState state; - if (!chainstate->ActivateBestChain(state, chainparams, nullptr)) { + if (!chainstate->ActivateBestChain(state, nullptr)) { LogPrintf("Failed to connect best block (%s)\n", state.ToString()); StartShutdown(); return; -- cgit v1.2.3