@@ -1673,20 +1673,15 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
16731673 dProgressStart = GuessVerificationProgress (chainParams.TxData (), pindex);
16741674 dProgressTip = GuessVerificationProgress (chainParams.TxData (), tip);
16751675 }
1676+ double gvp = dProgressStart;
16761677 while (pindex && !fAbortRescan )
16771678 {
16781679 if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0 ) {
1679- double gvp = 0 ;
1680- {
1681- LOCK (cs_main);
1682- gvp = GuessVerificationProgress (chainParams.TxData (), pindex);
1683- }
16841680 ShowProgress (_ (" Rescanning..." ), std::max (1 , std::min (99 , (int )((gvp - dProgressStart) / (dProgressTip - dProgressStart) * 100 ))));
16851681 }
16861682 if (GetTime () >= nNow + 60 ) {
16871683 nNow = GetTime ();
1688- LOCK (cs_main);
1689- LogPrintf (" Still rescanning. At block %d. Progress=%f\n " , pindex->nHeight , GuessVerificationProgress (chainParams.TxData (), pindex));
1684+ LogPrintf (" Still rescanning. At block %d. Progress=%f\n " , pindex->nHeight , gvp);
16901685 }
16911686
16921687 CBlock block;
@@ -1710,6 +1705,7 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
17101705 {
17111706 LOCK (cs_main);
17121707 pindex = chainActive.Next (pindex);
1708+ gvp = GuessVerificationProgress (chainParams.TxData (), pindex);
17131709 if (tip != chainActive.Tip ()) {
17141710 tip = chainActive.Tip ();
17151711 // in case the tip has changed, update progress max
@@ -1718,7 +1714,7 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
17181714 }
17191715 }
17201716 if (pindex && fAbortRescan ) {
1721- LogPrintf (" Rescan aborted at block %d. Progress=%f\n " , pindex->nHeight , GuessVerificationProgress (chainParams. TxData (), pindex) );
1717+ LogPrintf (" Rescan aborted at block %d. Progress=%f\n " , pindex->nHeight , gvp );
17221718 }
17231719 ShowProgress (_ (" Rescanning..." ), 100 ); // hide progress dialog in GUI
17241720 }
0 commit comments