@@ -2363,7 +2363,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const CoinEligibil
23632363 std::vector<OutputGroup> utxo_pool;
23642364 if (coin_selection_params.use_bnb ) {
23652365 // Calculate cost of change
2366- CAmount cost_of_change = coin_selection_params.m_discard_feerate .GetFee (coin_selection_params.change_spend_size ) + coin_selection_params.effective_fee .GetFee (coin_selection_params.change_output_size );
2366+ CAmount cost_of_change = coin_selection_params.m_discard_feerate .GetFee (coin_selection_params.change_spend_size ) + coin_selection_params.m_effective_feerate .GetFee (coin_selection_params.change_output_size );
23672367
23682368 // Filter by the min conf specs and add to utxo_pool and calculate effective value
23692369 for (OutputGroup& group : groups) {
@@ -2373,14 +2373,14 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const CoinEligibil
23732373 // Set the effective feerate to 0 as we don't want to use the effective value since the fees will be deducted from the output
23742374 group.SetFees (CFeeRate (0 ) /* effective_feerate */ , coin_selection_params.m_long_term_feerate );
23752375 } else {
2376- group.SetFees (coin_selection_params.effective_fee , coin_selection_params.m_long_term_feerate );
2376+ group.SetFees (coin_selection_params.m_effective_feerate , coin_selection_params.m_long_term_feerate );
23772377 }
23782378
23792379 OutputGroup pos_group = group.GetPositiveOnlyGroup ();
23802380 if (pos_group.effective_value > 0 ) utxo_pool.push_back (pos_group);
23812381 }
23822382 // Calculate the fees for things that aren't inputs
2383- CAmount not_input_fees = coin_selection_params.effective_fee .GetFee (coin_selection_params.tx_noinputs_size );
2383+ CAmount not_input_fees = coin_selection_params.m_effective_feerate .GetFee (coin_selection_params.tx_noinputs_size );
23842384 bnb_used = true ;
23852385 return SelectCoinsBnB (utxo_pool, nTargetValue, cost_of_change, setCoinsRet, nValueRet, not_input_fees);
23862386 } else {
@@ -2437,7 +2437,7 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
24372437 if (coin.m_input_bytes <= 0 ) {
24382438 return false ; // Not solvable, can't estimate size for fee
24392439 }
2440- coin.effective_value = coin.txout .nValue - coin_selection_params.effective_fee .GetFee (coin.m_input_bytes );
2440+ coin.effective_value = coin.txout .nValue - coin_selection_params.m_effective_feerate .GetFee (coin.m_input_bytes );
24412441 if (coin_selection_params.use_bnb ) {
24422442 value_to_select -= coin.effective_value ;
24432443 } else {
@@ -2809,11 +2809,11 @@ bool CWallet::CreateTransactionInternal(
28092809 coin_selection_params.m_discard_feerate = GetDiscardRate (*this );
28102810
28112811 // Get the fee rate to use effective values in coin selection
2812- coin_selection_params.effective_fee = GetMinimumFeeRate (*this , coin_control, &feeCalc);
2812+ coin_selection_params.m_effective_feerate = GetMinimumFeeRate (*this , coin_control, &feeCalc);
28132813 // Do not, ever, assume that it's fine to change the fee rate if the user has explicitly
28142814 // provided one
2815- if (coin_control.m_feerate && coin_selection_params.effective_fee > *coin_control.m_feerate ) {
2816- error = strprintf (_ (" Fee rate (%s) is lower than the minimum fee rate setting (%s)" ), coin_control.m_feerate ->ToString (FeeEstimateMode::SAT_VB), coin_selection_params.effective_fee .ToString (FeeEstimateMode::SAT_VB));
2815+ if (coin_control.m_feerate && coin_selection_params.m_effective_feerate > *coin_control.m_feerate ) {
2816+ error = strprintf (_ (" Fee rate (%s) is lower than the minimum fee rate setting (%s)" ), coin_control.m_feerate ->ToString (FeeEstimateMode::SAT_VB), coin_selection_params.m_effective_feerate .ToString (FeeEstimateMode::SAT_VB));
28172817 return false ;
28182818 }
28192819 if (feeCalc.reason == FeeReason::FALLBACK && !m_allow_fallback_fee) {
@@ -2962,7 +2962,7 @@ bool CWallet::CreateTransactionInternal(
29622962 return false ;
29632963 }
29642964
2965- nFeeNeeded = coin_selection_params.effective_fee .GetFee (nBytes);
2965+ nFeeNeeded = coin_selection_params.m_effective_feerate .GetFee (nBytes);
29662966 if (nFeeRet >= nFeeNeeded) {
29672967 // Reduce fee to only the needed amount if possible. This
29682968 // prevents potential overpayment in fees if the coins
@@ -2976,7 +2976,7 @@ bool CWallet::CreateTransactionInternal(
29762976 // change output. Only try this once.
29772977 if (nChangePosInOut == -1 && nSubtractFeeFromAmount == 0 && pick_new_inputs) {
29782978 unsigned int tx_size_with_change = nBytes + coin_selection_params.change_output_size + 2 ; // Add 2 as a buffer in case increasing # of outputs changes compact size
2979- CAmount fee_needed_with_change = coin_selection_params.effective_fee .GetFee (tx_size_with_change);
2979+ CAmount fee_needed_with_change = coin_selection_params.m_effective_feerate .GetFee (tx_size_with_change);
29802980 CAmount minimum_value_for_change = GetDustThreshold (change_prototype_txout, coin_selection_params.m_discard_feerate );
29812981 if (nFeeRet >= fee_needed_with_change + minimum_value_for_change) {
29822982 pick_new_inputs = false ;
0 commit comments