From fcfe09d196a945a42b82496c2497fcc45e30b305 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sat, 12 Nov 2022 04:17:35 -0800 Subject: [PATCH] chainActive.Tip() can be NULL if have never synced to a chain tip before, so use chainActive.Height() instead --- src/init.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index ec2d3bdb1..b4cc62797 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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();