From b3f9e8186efa1c31f37d19560057fef067de6d70 Mon Sep 17 00:00:00 2001 From: lateminer <9951982+lateminer@users.noreply.github.com> Date: Sat, 27 Jan 2024 20:24:26 +0100 Subject: [PATCH] pos: Do not add more inputs if nCredit >= GetStakeCombineThreshold() --- src/wallet/staking.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wallet/staking.cpp b/src/wallet/staking.cpp index 7432ae9e75..dae96c72eb 100644 --- a/src/wallet/staking.cpp +++ b/src/wallet/staking.cpp @@ -422,6 +422,9 @@ bool CreateCoinStake(CWallet& wallet, unsigned int nBits, int64_t nSearchInterva // Stop adding more inputs if already too many inputs if (txNew.vin.size() >= 10) break; + // Stop adding more inputs if value is already pretty significant + if (nCredit >= GetStakeCombineThreshold()) + break; // Stop adding inputs if reached reserve limit if (nCredit + pcoin.first->tx->vout[pcoin.second].nValue > nBalance - wallet.m_reserve_balance) break;