@@ -1673,20 +1673,15 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
1673
1673
dProgressStart = GuessVerificationProgress (chainParams.TxData (), pindex);
1674
1674
dProgressTip = GuessVerificationProgress (chainParams.TxData (), tip);
1675
1675
}
1676
+ double gvp = dProgressStart;
1676
1677
while (pindex && !fAbortRescan )
1677
1678
{
1678
1679
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
- }
1684
1680
ShowProgress (_ (" Rescanning..." ), std::max (1 , std::min (99 , (int )((gvp - dProgressStart) / (dProgressTip - dProgressStart) * 100 ))));
1685
1681
}
1686
1682
if (GetTime () >= nNow + 60 ) {
1687
1683
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);
1690
1685
}
1691
1686
1692
1687
CBlock block;
@@ -1710,6 +1705,7 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
1710
1705
{
1711
1706
LOCK (cs_main);
1712
1707
pindex = chainActive.Next (pindex);
1708
+ gvp = GuessVerificationProgress (chainParams.TxData (), pindex);
1713
1709
if (tip != chainActive.Tip ()) {
1714
1710
tip = chainActive.Tip ();
1715
1711
// in case the tip has changed, update progress max
@@ -1718,7 +1714,7 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlock
1718
1714
}
1719
1715
}
1720
1716
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 );
1722
1718
}
1723
1719
ShowProgress (_ (" Rescanning..." ), 100 ); // hide progress dialog in GUI
1724
1720
}
0 commit comments