diff options
-rw-r--r-- | src/init.cpp | 7 | ||||
-rw-r--r-- | src/node/chainstate.cpp | 5 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp index 411692d88b..0c5baeee3b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1477,11 +1477,16 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) std::optional<ChainstateLoadVerifyError> rv2; try { uiInterface.InitMessage(_("Verifying blocks…").translated); + auto check_blocks = args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS); + if (fHavePruned && 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, fReset, fReindexChainState, chainparams, - args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS), + check_blocks, args.GetIntArg("-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 99bf3d8e94..c795c740e4 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -143,11 +143,6 @@ std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManage for (CChainState* chainstate : chainman.GetAll()) { if (!is_coinsview_empty(chainstate)) { - if (fHavePruned && 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) { |