diff options
author | Carl Dong <contact@carldong.me> | 2021-11-12 18:15:47 -0500 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-12-06 16:41:58 -0500 |
commit | 8d466a8504bfb81ce8699d650aa72ec9cc8b0a54 (patch) | |
tree | 582392dd69ad01396c4c2b47002c4f181e4bd10d /src/init.cpp | |
parent | aad8d597890c3707ae96fdb2b9fadc270ca574dd (diff) |
Move -checkblocks LogPrintf to AppInitMain
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 7 |
1 files changed, 6 insertions, 1 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()); |