[wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call.
This commit is contained in:
parent
1b25b6df0f
commit
c36ea693ee
1 changed files with 4 additions and 4 deletions
|
@ -1544,6 +1544,10 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool f
|
||||||
{
|
{
|
||||||
if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0)
|
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))));
|
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;
|
CBlock block;
|
||||||
if (ReadBlockFromDisk(block, pindex, Params().GetConsensus())) {
|
if (ReadBlockFromDisk(block, pindex, Params().GetConsensus())) {
|
||||||
|
@ -1557,10 +1561,6 @@ CBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool f
|
||||||
ret = nullptr;
|
ret = nullptr;
|
||||||
}
|
}
|
||||||
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, GuessVerificationProgress(chainParams.TxData(), pindex));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (pindex && fAbortRescan) {
|
if (pindex && fAbortRescan) {
|
||||||
LogPrintf("Rescan aborted at block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));
|
LogPrintf("Rescan aborted at block %d. Progress=%f\n", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));
|
||||||
|
|
Loading…
Reference in a new issue