Skip to content

Commit 06c5b6e

Browse files
committed
Show txdb upgrade progress in debug log
1 parent 316fcb5 commit 06c5b6e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/txdb.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ bool CCoinsViewDB::Upgrade() {
369369
}
370370

371371
int64_t count = 0;
372-
LogPrintf("Upgrading database...\n");
372+
LogPrintf("Upgrading utxo-set database...\n");
373+
LogPrintf("[0%%]...");
373374
size_t batch_size = 1 << 24;
374375
CDBBatch batch(db);
375376
uiInterface.SetProgressBreakAction(StartShutdown);
@@ -383,6 +384,7 @@ bool CCoinsViewDB::Upgrade() {
383384
if (count++ % 256 == 0) {
384385
uint32_t high = 0x100 * *key.second.begin() + *(key.second.begin() + 1);
385386
uiInterface.ShowProgress(_("Upgrading UTXO database") + "\n"+ _("(press q to shutdown and continue later)") + "\n", (int)(high * 100.0 / 65536.0 + 0.5));
387+
LogPrintf("[%d%%]...", (int)(high * 100.0 / 65536.0 + 0.5));
386388
}
387389
CCoins old_coins;
388390
if (!pcursor->GetValue(old_coins)) {
@@ -409,5 +411,6 @@ bool CCoinsViewDB::Upgrade() {
409411
}
410412
db.WriteBatch(batch);
411413
uiInterface.SetProgressBreakAction(std::function<void(void)>());
414+
LogPrintf("[DONE].\n");
412415
return true;
413416
}

0 commit comments

Comments
 (0)