Skip to content

Commit 8d466a8

Browse files
committed
Move -checkblocks LogPrintf to AppInitMain
1 parent aad8d59 commit 8d466a8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/init.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,11 +1477,16 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
14771477
std::optional<ChainstateLoadVerifyError> rv2;
14781478
try {
14791479
uiInterface.InitMessage(_("Verifying blocks…").translated);
1480+
auto check_blocks = args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS);
1481+
if (fHavePruned && check_blocks > MIN_BLOCKS_TO_KEEP) {
1482+
LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks\n",
1483+
MIN_BLOCKS_TO_KEEP);
1484+
}
14801485
rv2 = VerifyLoadedChainstate(chainman,
14811486
fReset,
14821487
fReindexChainState,
14831488
chainparams,
1484-
args.GetIntArg("-checkblocks", DEFAULT_CHECKBLOCKS),
1489+
check_blocks,
14851490
args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL));
14861491
} catch (const std::exception& e) {
14871492
LogPrintf("%s\n", e.what());

src/node/chainstate.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,6 @@ std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManage
143143

144144
for (CChainState* chainstate : chainman.GetAll()) {
145145
if (!is_coinsview_empty(chainstate)) {
146-
if (fHavePruned && check_blocks > MIN_BLOCKS_TO_KEEP) {
147-
LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks\n",
148-
MIN_BLOCKS_TO_KEEP);
149-
}
150-
151146
const CBlockIndex* tip = chainstate->m_chain.Tip();
152147
RPCNotifyBlockChange(tip);
153148
if (tip && tip->nTime > GetTime() + MAX_FUTURE_BLOCK_TIME) {

0 commit comments

Comments
 (0)