@@ -2585,16 +2585,17 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
2585
2585
++it;
2586
2586
}
2587
2587
2588
- size_t nMaxChainLength = (size_t )std::max<int64_t >(1 , std::min (gArgs .GetArg (" -limitancestorcount" , DEFAULT_ANCESTOR_LIMIT), gArgs .GetArg (" -limitdescendantcount" , DEFAULT_DESCENDANT_LIMIT)));
2588
+ size_t max_ancestors = (size_t )std::max<int64_t >(1 , gArgs .GetArg (" -limitancestorcount" , DEFAULT_ANCESTOR_LIMIT));
2589
+ size_t max_descendants = (size_t )std::max<int64_t >(1 , gArgs .GetArg (" -limitdescendantcount" , DEFAULT_DESCENDANT_LIMIT));
2589
2590
bool fRejectLongChains = gArgs .GetBoolArg (" -walletrejectlongchains" , DEFAULT_WALLET_REJECT_LONG_CHAINS);
2590
2591
2591
2592
bool res = nTargetValue <= nValueFromPresetInputs ||
2592
2593
SelectCoinsMinConf (nTargetValue - nValueFromPresetInputs, CoinEligibilityFilter (1 , 6 , 0 ), vCoins, setCoinsRet, nValueRet, coin_selection_params, bnb_used) ||
2593
2594
SelectCoinsMinConf (nTargetValue - nValueFromPresetInputs, CoinEligibilityFilter (1 , 1 , 0 ), vCoins, setCoinsRet, nValueRet, coin_selection_params, bnb_used) ||
2594
2595
(m_spend_zero_conf_change && SelectCoinsMinConf (nTargetValue - nValueFromPresetInputs, CoinEligibilityFilter (0 , 1 , 2 ), vCoins, setCoinsRet, nValueRet, coin_selection_params, bnb_used)) ||
2595
- (m_spend_zero_conf_change && SelectCoinsMinConf (nTargetValue - nValueFromPresetInputs, CoinEligibilityFilter (0 , 1 , std::min ((size_t )4 , nMaxChainLength /3 )), vCoins, setCoinsRet, nValueRet, coin_selection_params, bnb_used)) ||
2596
- (m_spend_zero_conf_change && SelectCoinsMinConf (nTargetValue - nValueFromPresetInputs, CoinEligibilityFilter (0 , 1 , nMaxChainLength /2 ), vCoins, setCoinsRet, nValueRet, coin_selection_params, bnb_used)) ||
2597
- (m_spend_zero_conf_change && SelectCoinsMinConf (nTargetValue - nValueFromPresetInputs, CoinEligibilityFilter (0 , 1 , nMaxChainLength -1 ), vCoins, setCoinsRet, nValueRet, coin_selection_params, bnb_used)) ||
2596
+ (m_spend_zero_conf_change && SelectCoinsMinConf (nTargetValue - nValueFromPresetInputs, CoinEligibilityFilter (0 , 1 , std::min ((size_t )4 , max_ancestors/ 3 ), std::min (( size_t ) 4 , max_descendants /3 )), vCoins, setCoinsRet, nValueRet, coin_selection_params, bnb_used)) ||
2597
+ (m_spend_zero_conf_change && SelectCoinsMinConf (nTargetValue - nValueFromPresetInputs, CoinEligibilityFilter (0 , 1 , max_ancestors/ 2 , max_descendants /2 ), vCoins, setCoinsRet, nValueRet, coin_selection_params, bnb_used)) ||
2598
+ (m_spend_zero_conf_change && SelectCoinsMinConf (nTargetValue - nValueFromPresetInputs, CoinEligibilityFilter (0 , 1 , max_ancestors- 1 , max_descendants -1 ), vCoins, setCoinsRet, nValueRet, coin_selection_params, bnb_used)) ||
2598
2599
(m_spend_zero_conf_change && !fRejectLongChains && SelectCoinsMinConf (nTargetValue - nValueFromPresetInputs, CoinEligibilityFilter (0 , 1 , std::numeric_limits<uint64_t >::max ()), vCoins, setCoinsRet, nValueRet, coin_selection_params, bnb_used));
2599
2600
2600
2601
// because SelectCoinsMinConf clears the setCoinsRet, we now add the possible inputs to the coinset
0 commit comments