Skip to content

Commit 1264b36

Browse files
committed
Merge pull request #3696
c4656e0 Add progress to initial display of latest block downloaded. (R E Broadley) 75b8953 Display progress of rescan. (R E Broadley)
2 parents a63f8b7 + c4656e0 commit 1264b36

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2844,9 +2844,10 @@ bool static LoadBlockIndexDB()
28442844
if (it == mapBlockIndex.end())
28452845
return true;
28462846
chainActive.SetTip(it->second);
2847-
LogPrintf("LoadBlockIndexDB(): hashBestChain=%s height=%d date=%s\n",
2847+
LogPrintf("LoadBlockIndexDB(): hashBestChain=%s height=%d date=%s progress=%f\n",
28482848
chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(),
2849-
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()));
2849+
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()),
2850+
Checkpoints::GuessVerificationProgress(chainActive.Tip()));
28502851

28512852
return true;
28522853
}

src/wallet.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "base58.h"
99
#include "coincontrol.h"
1010
#include "net.h"
11+
#include "checkpoints.h"
1112

1213
#include <boost/algorithm/string/replace.hpp>
1314
#include <openssl/rand.h>
@@ -830,6 +831,7 @@ bool CWalletTx::WriteToDisk()
830831
int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
831832
{
832833
int ret = 0;
834+
int64_t nNow = GetTime();
833835

834836
CBlockIndex* pindex = pindexStart;
835837
{
@@ -851,6 +853,10 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
851853
ret++;
852854
}
853855
pindex = chainActive.Next(pindex);
856+
if (GetTime() >= nNow + 60) {
857+
nNow = GetTime();
858+
LogPrintf("Still rescanning. At block %d. Progress=%f\n", pindex->nHeight, Checkpoints::GuessVerificationProgress(pindex));
859+
}
854860
}
855861
}
856862
return ret;

0 commit comments

Comments
 (0)