From 75b8953a2cb98651f546a457927fef0693dfb349 Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Mon, 17 Feb 2014 16:35:37 -0800 Subject: [PATCH 1/2] Display progress of rescan. --- src/wallet.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wallet.cpp b/src/wallet.cpp index 823c96949..cd48571a9 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -8,6 +8,7 @@ #include "base58.h" #include "coincontrol.h" #include "net.h" +#include "checkpoints.h" #include @@ -890,6 +891,7 @@ bool CWalletTx::WriteToDisk() int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) { int ret = 0; + int64_t nNow = GetTime(); CBlockIndex* pindex = pindexStart; { @@ -911,6 +913,10 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) ret++; } pindex = chainActive.Next(pindex); + if (GetTime() >= nNow + 60) { + nNow = GetTime(); + LogPrintf("Still rescanning. At block %d. Progress=%f\n", pindex->nHeight, Checkpoints::GuessVerificationProgress(pindex)); + } } } return ret; From c4656e0d888703b774e1fd889fff4696113c117c Mon Sep 17 00:00:00 2001 From: R E Broadley Date: Tue, 18 Feb 2014 11:04:06 -0800 Subject: [PATCH 2/2] Add progress to initial display of latest block downloaded. --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f61b28286..8c046ac92 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2743,9 +2743,10 @@ bool static LoadBlockIndexDB() if (it == mapBlockIndex.end()) return true; chainActive.SetTip(it->second); - LogPrintf("LoadBlockIndexDB(): hashBestChain=%s height=%d date=%s\n", + LogPrintf("LoadBlockIndexDB(): hashBestChain=%s height=%d date=%s progress=%f\n", chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), - DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime())); + DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()), + Checkpoints::GuessVerificationProgress(chainActive.Tip())); return true; }