Skip to content

Commit 5127486

Browse files
committed
Move ReindexAccumulators() call to be inside parent conditional
Not much point in checking if the listAccCheckpointsNoDB list is empty outside of when the wallet is started using `-reindexaccumulators`, as it is always empty outside of that case.
1 parent bed79e2 commit 5127486

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/init.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
11301130
filesystem::path chainstateDir = GetDataDir() / "chainstate";
11311131
filesystem::path sporksDir = GetDataDir() / "sporks";
11321132
filesystem::path zerocoinDir = GetDataDir() / "zerocoin";
1133-
1133+
11341134
LogPrintf("Deleting blockchain folders blocks, chainstate, sporks and zerocoin\n");
11351135
// We delete in 4 individual steps in case one of the folder is missing already
11361136
try {
@@ -1466,19 +1466,18 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
14661466
listAccCheckpointsNoDB.emplace_back(pindex->nAccumulatorCheckpoint);
14671467
pindex = chainActive.Next(pindex);
14681468
}
1469+
// PIVX: recalculate Accumulator Checkpoints that failed to database properly
1470+
if (!listAccCheckpointsNoDB.empty()) {
1471+
uiInterface.InitMessage(_("Calculating missing accumulators..."));
1472+
LogPrintf("%s : finding missing checkpoints\n", __func__);
1473+
1474+
string strError;
1475+
if (!ReindexAccumulators(listAccCheckpointsNoDB, strError))
1476+
return InitError(strError);
1477+
}
14691478
}
14701479
}
14711480

1472-
// PIVX: recalculate Accumulator Checkpoints that failed to database properly
1473-
if (!listAccCheckpointsNoDB.empty()) {
1474-
uiInterface.InitMessage(_("Calculating missing accumulators..."));
1475-
LogPrintf("%s : finding missing checkpoints\n", __func__);
1476-
1477-
string strError;
1478-
if (!ReindexAccumulators(listAccCheckpointsNoDB, strError))
1479-
return InitError(strError);
1480-
}
1481-
14821481
uiInterface.InitMessage(_("Verifying blocks..."));
14831482

14841483
// Flag sent to validation code to let it know it can skip certain checks

0 commit comments

Comments
 (0)