@@ -2368,16 +2368,16 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const CoinEligibil
2368
2368
// When subtracting the fee from the outputs, we want the effective feerate to be 0
2369
2369
CFeeRate effective_feerate{0 };
2370
2370
if (!coin_selection_params.m_subtract_fee_outputs ) {
2371
- effective_feerate = coin_selection_params.effective_fee ;
2371
+ effective_feerate = coin_selection_params.m_effective_feerate ;
2372
2372
}
2373
2373
2374
2374
std::vector<OutputGroup> groups = GroupOutputs (coins, !coin_selection_params.m_avoid_partial_spends , effective_feerate, coin_selection_params.m_long_term_feerate , eligibility_filter, true /* positive_only */ );
2375
2375
2376
2376
// Calculate cost of change
2377
- 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 );
2377
+ 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 );
2378
2378
2379
2379
// Calculate the fees for things that aren't inputs
2380
- CAmount not_input_fees = coin_selection_params.effective_fee .GetFee (coin_selection_params.tx_noinputs_size );
2380
+ CAmount not_input_fees = coin_selection_params.m_effective_feerate .GetFee (coin_selection_params.tx_noinputs_size );
2381
2381
bnb_used = true ;
2382
2382
return SelectCoinsBnB (groups, nTargetValue, cost_of_change, setCoinsRet, nValueRet, not_input_fees);
2383
2383
} else {
@@ -2431,7 +2431,7 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
2431
2431
if (coin.m_input_bytes <= 0 ) {
2432
2432
return false ; // Not solvable, can't estimate size for fee
2433
2433
}
2434
- coin.effective_value = coin.txout .nValue - coin_selection_params.effective_fee .GetFee (coin.m_input_bytes );
2434
+ coin.effective_value = coin.txout .nValue - coin_selection_params.m_effective_feerate .GetFee (coin.m_input_bytes );
2435
2435
if (coin_selection_params.use_bnb ) {
2436
2436
value_to_select -= coin.effective_value ;
2437
2437
} else {
@@ -2802,11 +2802,11 @@ bool CWallet::CreateTransactionInternal(
2802
2802
coin_selection_params.m_discard_feerate = GetDiscardRate (*this );
2803
2803
2804
2804
// Get the fee rate to use effective values in coin selection
2805
- coin_selection_params.effective_fee = GetMinimumFeeRate (*this , coin_control, &feeCalc);
2805
+ coin_selection_params.m_effective_feerate = GetMinimumFeeRate (*this , coin_control, &feeCalc);
2806
2806
// Do not, ever, assume that it's fine to change the fee rate if the user has explicitly
2807
2807
// provided one
2808
- if (coin_control.m_feerate && coin_selection_params.effective_fee > *coin_control.m_feerate ) {
2809
- 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));
2808
+ if (coin_control.m_feerate && coin_selection_params.m_effective_feerate > *coin_control.m_feerate ) {
2809
+ 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));
2810
2810
return false ;
2811
2811
}
2812
2812
if (feeCalc.reason == FeeReason::FALLBACK && !m_allow_fallback_fee) {
@@ -2955,7 +2955,7 @@ bool CWallet::CreateTransactionInternal(
2955
2955
return false ;
2956
2956
}
2957
2957
2958
- nFeeNeeded = coin_selection_params.effective_fee .GetFee (nBytes);
2958
+ nFeeNeeded = coin_selection_params.m_effective_feerate .GetFee (nBytes);
2959
2959
if (nFeeRet >= nFeeNeeded) {
2960
2960
// Reduce fee to only the needed amount if possible. This
2961
2961
// prevents potential overpayment in fees if the coins
@@ -2969,7 +2969,7 @@ bool CWallet::CreateTransactionInternal(
2969
2969
// change output. Only try this once.
2970
2970
if (nChangePosInOut == -1 && nSubtractFeeFromAmount == 0 && pick_new_inputs) {
2971
2971
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
2972
- CAmount fee_needed_with_change = coin_selection_params.effective_fee .GetFee (tx_size_with_change);
2972
+ CAmount fee_needed_with_change = coin_selection_params.m_effective_feerate .GetFee (tx_size_with_change);
2973
2973
CAmount minimum_value_for_change = GetDustThreshold (change_prototype_txout, coin_selection_params.m_discard_feerate );
2974
2974
if (nFeeRet >= fee_needed_with_change + minimum_value_for_change) {
2975
2975
pick_new_inputs = false ;
0 commit comments