File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -374,6 +374,7 @@ bool CCoinsViewDB::Upgrade() {
374
374
size_t batch_size = 1 << 24 ;
375
375
CDBBatch batch (db);
376
376
uiInterface.SetProgressBreakAction (StartShutdown);
377
+ int reportDone = 0 ;
377
378
while (pcursor->Valid ()) {
378
379
boost::this_thread::interruption_point ();
379
380
if (ShutdownRequested ()) {
@@ -383,8 +384,13 @@ bool CCoinsViewDB::Upgrade() {
383
384
if (pcursor->GetKey (key) && key.first == DB_COINS) {
384
385
if (count++ % 256 == 0 ) {
385
386
uint32_t high = 0x100 * *key.second .begin () + *(key.second .begin () + 1 );
386
- 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 ));
387
+ int percentageDone = (int )(high * 100.0 / 65536.0 + 0.5 );
388
+ uiInterface.ShowProgress (_ (" Upgrading UTXO database" ) + " \n " + _ (" (press q to shutdown and continue later)" ) + " \n " , percentageDone);
389
+ if (reportDone < percentageDone/10 ) {
390
+ // report max. every 10% step
391
+ LogPrintf (" [%d%%]..." , percentageDone);
392
+ reportDone = percentageDone/10 ;
393
+ }
388
394
}
389
395
CCoins old_coins;
390
396
if (!pcursor->GetValue (old_coins)) {
You can’t perform that action at this time.
0 commit comments