diff options
author | Karl-Johan Alm <karljohan-alm@garage.co.jp> | 2017-04-24 08:48:12 +0900 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2017-06-05 22:58:24 +0000 |
commit | ff13f592c5813b18340a6e9e65abb4e356aac400 (patch) | |
tree | 29342841f1c7646a99815288aa54cdb6c3d37dec /src | |
parent | e23cef0c9469cc360e603a614bb3f0b22c6656bf (diff) |
[wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call.
Github-Pull: #10265
Rebased-From: c36ea693ee16611e0337aec682d1ce80b90e1bd3
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 3e93a56d56..2697a3769a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1572,6 +1572,10 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool f { if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0) ShowProgress(_("Rescanning..."), std::max(1, std::min(99, (int)((GuessVerificationProgress(chainParams.TxData(), pindex) - dProgressStart) / (dProgressTip - dProgressStart) * 100)))); + if (GetTime() >= nNow + 60) { + nNow = GetTime(); + LogPrintf("Still rescanning. At block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex)); + } CBlock block; if (ReadBlockFromDisk(block, pindex, Params().GetConsensus())) { @@ -1585,10 +1589,6 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool f ret = nullptr; } pindex = chainActive.Next(pindex); - if (GetTime() >= nNow + 60) { - nNow = GetTime(); - LogPrintf("Still rescanning. At block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex)); - } } ShowProgress(_("Rescanning..."), 100); // hide progress dialog in GUI } |