Skip to content

Commit

Permalink
pos: Do not add more inputs if nCredit >= GetStakeCombineThreshold()
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Jan 27, 2024
1 parent cf2d566 commit b3f9e81
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wallet/staking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b3f9e81

Please sign in to comment.