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)
This commit is contained in:
Wladimir J. van der Laan 2014-03-11 09:17:44 +01:00
commit 1264b3647d
No known key found for this signature in database
GPG key ID: 74810B012346C9A6
2 changed files with 9 additions and 2 deletions

View file

@ -2844,9 +2844,10 @@ bool static LoadBlockIndexDB()
if (it == mapBlockIndex.end()) if (it == mapBlockIndex.end())
return true; return true;
chainActive.SetTip(it->second); 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(), 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; return true;
} }

View file

@ -8,6 +8,7 @@
#include "base58.h" #include "base58.h"
#include "coincontrol.h" #include "coincontrol.h"
#include "net.h" #include "net.h"
#include "checkpoints.h"
#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/replace.hpp>
#include <openssl/rand.h> #include <openssl/rand.h>
@ -830,6 +831,7 @@ bool CWalletTx::WriteToDisk()
int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
{ {
int ret = 0; int ret = 0;
int64_t nNow = GetTime();
CBlockIndex* pindex = pindexStart; CBlockIndex* pindex = pindexStart;
{ {
@ -851,6 +853,10 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
ret++; ret++;
} }
pindex = chainActive.Next(pindex); 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; return ret;