mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-05 17:30:59 +02:00
log: Log VerifyDB Progress over multiple lines
This allows to log a timestamp for each entry, and avoids potential interference with other threads that could log concurrently.
This commit is contained in:
parent
61431e3a57
commit
fe683f3524
@ -4082,7 +4082,7 @@ bool CVerifyDB::VerifyDB(
|
|||||||
BlockValidationState state;
|
BlockValidationState state;
|
||||||
int reportDone = 0;
|
int reportDone = 0;
|
||||||
bool skipped_l3_checks{false};
|
bool skipped_l3_checks{false};
|
||||||
LogPrintf("[0%%]..."); /* Continued */
|
LogPrintf("Verification progress: 0%%\n");
|
||||||
|
|
||||||
const bool is_snapshot_cs{!chainstate.m_from_snapshot_blockhash};
|
const bool is_snapshot_cs{!chainstate.m_from_snapshot_blockhash};
|
||||||
|
|
||||||
@ -4090,7 +4090,7 @@ bool CVerifyDB::VerifyDB(
|
|||||||
const int percentageDone = std::max(1, std::min(99, (int)(((double)(chainstate.m_chain.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100))));
|
const int percentageDone = std::max(1, std::min(99, (int)(((double)(chainstate.m_chain.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100))));
|
||||||
if (reportDone < percentageDone / 10) {
|
if (reportDone < percentageDone / 10) {
|
||||||
// report every 10% step
|
// report every 10% step
|
||||||
LogPrintf("[%d%%]...", percentageDone); /* Continued */
|
LogPrintf("Verification progress: %d%%\n", percentageDone);
|
||||||
reportDone = percentageDone / 10;
|
reportDone = percentageDone / 10;
|
||||||
}
|
}
|
||||||
uiInterface.ShowProgress(_("Verifying blocks…").translated, percentageDone, false);
|
uiInterface.ShowProgress(_("Verifying blocks…").translated, percentageDone, false);
|
||||||
@ -4159,7 +4159,7 @@ bool CVerifyDB::VerifyDB(
|
|||||||
const int percentageDone = std::max(1, std::min(99, 100 - (int)(((double)(chainstate.m_chain.Height() - pindex->nHeight)) / (double)nCheckDepth * 50)));
|
const int percentageDone = std::max(1, std::min(99, 100 - (int)(((double)(chainstate.m_chain.Height() - pindex->nHeight)) / (double)nCheckDepth * 50)));
|
||||||
if (reportDone < percentageDone / 10) {
|
if (reportDone < percentageDone / 10) {
|
||||||
// report every 10% step
|
// report every 10% step
|
||||||
LogPrintf("[%d%%]...", percentageDone); /* Continued */
|
LogPrintf("Verification progress: %d%%\n", percentageDone);
|
||||||
reportDone = percentageDone / 10;
|
reportDone = percentageDone / 10;
|
||||||
}
|
}
|
||||||
uiInterface.ShowProgress(_("Verifying blocks…").translated, percentageDone, false);
|
uiInterface.ShowProgress(_("Verifying blocks…").translated, percentageDone, false);
|
||||||
@ -4174,8 +4174,7 @@ bool CVerifyDB::VerifyDB(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf("[DONE].\n");
|
LogPrintf("Verification: No coin database inconsistencies in last %i blocks (%i transactions)\n", block_count, nGoodTransactions);
|
||||||
LogPrintf("No coin database inconsistencies in last %i blocks (%i transactions)\n", block_count, nGoodTransactions);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user