chainActive.Tip() can be NULL if have never synced to a chain tip before, so use chainActive.Height() instead

This commit is contained in:
Jonathan "Duke" Leto
2022-11-12 04:17:35 -08:00
parent ca52c6beb8
commit fcfe09d196

View File

@@ -2042,7 +2042,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
pwalletMain->consolidationInterval = consolidationInterval;
pwalletMain->nextConsolidation = pwalletMain->consolidationInterval + chainActive.Tip()->GetHeight();
pwalletMain->nextConsolidation = pwalletMain->consolidationInterval + chainActive.Height();
LogPrintf("%s: set nextConsolidation=%d\n", __func__, pwalletMain->nextConsolidation );
//Validate Sapling Addresses
@@ -2066,7 +2066,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
sweepInterval = 10;
}
pwalletMain->sweepInterval = sweepInterval;
pwalletMain->nextSweep = pwalletMain->sweepInterval + chainActive.Tip()->GetHeight();
pwalletMain->nextSweep = pwalletMain->sweepInterval + chainActive.Height();
LogPrintf("%s: set nextSweep=%d with sweepInterval=%d\n", __func__, pwalletMain->nextSweep, pwalletMain->sweepInterval );
fSweepTxFee = GetArg("-zsweepfee", DEFAULT_SWEEP_FEE);
fSweepMapUsed = !mapMultiArgs["-zsweepaddress"].empty();