mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +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;
|
std::optional<ChainstateLoadVerifyError> rv2;
|
||||||
try {
|
try {
|
||||||
uiInterface.InitMessage(_("Verifying blocks…").translated);
|
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,
|
rv2 = VerifyLoadedChainstate(chainman,
|
||||||
*Assert(node.evodb.get()),
|
*Assert(node.evodb.get()),
|
||||||
fReset,
|
fReset,
|
||||||
fReindexChainState,
|
fReindexChainState,
|
||||||
chainparams,
|
chainparams,
|
||||||
args.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS),
|
check_blocks,
|
||||||
args.GetArg("-checklevel", DEFAULT_CHECKLEVEL));
|
args.GetArg("-checklevel", DEFAULT_CHECKLEVEL));
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
LogPrintf("%s\n", e.what());
|
LogPrintf("%s\n", e.what());
|
||||||
|
@ -245,11 +245,6 @@ std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManage
|
|||||||
|
|
||||||
for (CChainState* chainstate : chainman.GetAll()) {
|
for (CChainState* chainstate : chainman.GetAll()) {
|
||||||
if (!is_coinsview_empty(chainstate)) {
|
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();
|
const CBlockIndex* tip = chainstate->m_chain.Tip();
|
||||||
RPCNotifyBlockChange(tip);
|
RPCNotifyBlockChange(tip);
|
||||||
if (tip && tip->nTime > GetTime() + MAX_FUTURE_BLOCK_TIME) {
|
if (tip && tip->nTime > GetTime() + MAX_FUTURE_BLOCK_TIME) {
|
||||||
|
Loading…
Reference in New Issue
Block a user