From 67a2e69e4dd371782416c3e97450b7c8458d329a Mon Sep 17 00:00:00 2001 From: "James C. Owens" Date: Thu, 20 Jan 2022 00:42:03 -0500 Subject: [PATCH] This fixes a missing miner search interval update In the special case where there are no coins available to stake, the CreateCoinStake loop ends early and never calls the update search at the bottom. This puts the call inside the if statement that executes if there are no coins to ensure the miner status properly updates to no staking if all of the UTXOs are on cooldown --- src/miner.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/miner.cpp b/src/miner.cpp index a7048eefa9..5b1ed811bd 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -489,6 +489,16 @@ bool CreateCoinStake(CBlock &blocknew, CKey &key, if (!wallet.SelectCoinsForStaking(txnew.nTime, CoinsToStake, error_flag, balance, true)) { + g_miner_status.UpdateLastSearch( + kernel_found, + txnew.nTime, + blocknew.nVersion, + StakeWeightSum, + StakeValueSum, + 0, // This should be set to zero for an unsuccessful iteration due to no stakeable coins. + StakeWeightMax, + GRC::CalculateStakeWeightV8(balance)); + g_miner_status.UpdateCurrentErrors(error_flag); LogPrint(BCLog::LogFlags::VERBOSE, "%s: %s", __func__, g_miner_status.FormatErrors());