diff --git a/src/init.cpp b/src/init.cpp index 007b64113b..f6e4de9e55 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1960,12 +1960,17 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) std::optional rv2; try { uiInterface.InitMessage(_("Verifying blocks…").translated); + auto check_blocks = args.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS); + if (chainman.m_blockman.m_have_pruned && check_blocks > MIN_BLOCKS_TO_KEEP) { + LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks\n", + MIN_BLOCKS_TO_KEEP); + } rv2 = VerifyLoadedChainstate(chainman, *Assert(node.evodb.get()), fReset, fReindexChainState, chainparams, - args.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS), + check_blocks, args.GetArg("-checklevel", DEFAULT_CHECKLEVEL)); } catch (const std::exception& e) { LogPrintf("%s\n", e.what()); diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index 35165200fa..88cb8add95 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -245,11 +245,6 @@ std::optional VerifyLoadedChainstate(ChainstateManage for (CChainState* chainstate : chainman.GetAll()) { if (!is_coinsview_empty(chainstate)) { - if (chainman.m_blockman.m_have_pruned && check_blocks > MIN_BLOCKS_TO_KEEP) { - LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks\n", - MIN_BLOCKS_TO_KEEP); - } - const CBlockIndex* tip = chainstate->m_chain.Tip(); RPCNotifyBlockChange(tip); if (tip && tip->nTime > GetTime() + MAX_FUTURE_BLOCK_TIME) {