mirror of
https://github.com/dashpay/dash.git
synced 2024-12-23 19:12:47 +01:00
Move -checkblocks LogPrintf to AppInitMain
This commit is contained in:
parent
d3345eeccc
commit
94c0ceb29c
@ -1960,12 +1960,17 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
std::optional<ChainstateLoadVerifyError> 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());
|
||||
|
@ -245,11 +245,6 @@ std::optional<ChainstateLoadVerifyError> 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user