diff options
author | Martin Zumsande <mzumsande@gmail.com> | 2022-10-03 14:49:13 -0400 |
---|---|---|
committer | Martin Zumsande <mzumsande@gmail.com> | 2023-01-31 10:43:39 -0500 |
commit | fe683f352480245add0b27fe7efef5fef4c1e8c3 (patch) | |
tree | da53b30578a8609f53f9b2f761d6555952017ef2 | |
parent | 61431e3a57b5613d8715c93c6eae0058e0217eaa (diff) |
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.
-rw-r--r-- | src/validation.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index cbb43c9b2b..f0ffb748dd 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4082,7 +4082,7 @@ bool CVerifyDB::VerifyDB( BlockValidationState state; int reportDone = 0; bool skipped_l3_checks{false}; - LogPrintf("[0%%]..."); /* Continued */ + LogPrintf("Verification progress: 0%%\n"); 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)))); if (reportDone < percentageDone / 10) { // report every 10% step - LogPrintf("[%d%%]...", percentageDone); /* Continued */ + LogPrintf("Verification progress: %d%%\n", percentageDone); reportDone = percentageDone / 10; } 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))); if (reportDone < percentageDone / 10) { // report every 10% step - LogPrintf("[%d%%]...", percentageDone); /* Continued */ + LogPrintf("Verification progress: %d%%\n", percentageDone); reportDone = percentageDone / 10; } uiInterface.ShowProgress(_("Verifying blocks…").translated, percentageDone, false); @@ -4174,8 +4174,7 @@ bool CVerifyDB::VerifyDB( } } - LogPrintf("[DONE].\n"); - LogPrintf("No coin database inconsistencies in last %i blocks (%i transactions)\n", block_count, nGoodTransactions); + LogPrintf("Verification: No coin database inconsistencies in last %i blocks (%i transactions)\n", block_count, nGoodTransactions); return true; } |