@@ -2600,17 +2600,6 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nC
2600
2600
return true ;
2601
2601
}
2602
2602
2603
- CFeeRate GetDiscardRate (const CBlockPolicyEstimator& estimator)
2604
- {
2605
- unsigned int highest_target = estimator.HighestTargetTracked (FeeEstimateHorizon::LONG_HALFLIFE);
2606
- CFeeRate discard_rate = estimator.estimateSmartFee (highest_target, nullptr /* FeeCalculation */ , false /* conservative */ );
2607
- // Don't let discard_rate be greater than longest possible fee estimate if we get a valid fee estimate
2608
- discard_rate = (discard_rate == CFeeRate (0 )) ? CWallet::m_discard_rate : std::min (discard_rate, CWallet::m_discard_rate);
2609
- // Discard rate must be at least dustRelayFee
2610
- discard_rate = std::max (discard_rate, ::dustRelayFee);
2611
- return discard_rate;
2612
- }
2613
-
2614
2603
bool CWallet::CreateTransaction (const std::vector<CRecipient>& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet,
2615
2604
int & nChangePosInOut, std::string& strFailReason, const CCoinControl& coin_control, bool sign)
2616
2605
{
@@ -3032,71 +3021,6 @@ bool CWallet::AddAccountingEntry(const CAccountingEntry& acentry, CWalletDB *pwa
3032
3021
return true ;
3033
3022
}
3034
3023
3035
- CAmount GetRequiredFee (unsigned int nTxBytes)
3036
- {
3037
- return std::max (CWallet::minTxFee.GetFee (nTxBytes), ::minRelayTxFee.GetFee (nTxBytes));
3038
- }
3039
-
3040
- CAmount GetMinimumFee (unsigned int nTxBytes, const CCoinControl& coin_control, const CTxMemPool& pool, const CBlockPolicyEstimator& estimator, FeeCalculation *feeCalc)
3041
- {
3042
- /* User control of how to calculate fee uses the following parameter precedence:
3043
- 1. coin_control.m_feerate
3044
- 2. coin_control.m_confirm_target
3045
- 3. payTxFee (user-set global variable)
3046
- 4. nTxConfirmTarget (user-set global variable)
3047
- The first parameter that is set is used.
3048
- */
3049
- CAmount fee_needed;
3050
- if (coin_control.m_feerate ) { // 1.
3051
- fee_needed = coin_control.m_feerate ->GetFee (nTxBytes);
3052
- if (feeCalc) feeCalc->reason = FeeReason::PAYTXFEE;
3053
- // Allow to override automatic min/max check over coin control instance
3054
- if (coin_control.fOverrideFeeRate ) return fee_needed;
3055
- }
3056
- else if (!coin_control.m_confirm_target && ::payTxFee != CFeeRate (0 )) { // 3. TODO: remove magic value of 0 for global payTxFee
3057
- fee_needed = ::payTxFee.GetFee (nTxBytes);
3058
- if (feeCalc) feeCalc->reason = FeeReason::PAYTXFEE;
3059
- }
3060
- else { // 2. or 4.
3061
- // We will use smart fee estimation
3062
- unsigned int target = coin_control.m_confirm_target ? *coin_control.m_confirm_target : ::nTxConfirmTarget;
3063
- // By default estimates are economical iff we are signaling opt-in-RBF
3064
- bool conservative_estimate = !coin_control.signalRbf ;
3065
- // Allow to override the default fee estimate mode over the CoinControl instance
3066
- if (coin_control.m_fee_mode == FeeEstimateMode::CONSERVATIVE) conservative_estimate = true ;
3067
- else if (coin_control.m_fee_mode == FeeEstimateMode::ECONOMICAL) conservative_estimate = false ;
3068
-
3069
- fee_needed = estimator.estimateSmartFee (target, feeCalc, conservative_estimate).GetFee (nTxBytes);
3070
- if (fee_needed == 0 ) {
3071
- // if we don't have enough data for estimateSmartFee, then use fallbackFee
3072
- fee_needed = CWallet::fallbackFee.GetFee (nTxBytes);
3073
- if (feeCalc) feeCalc->reason = FeeReason::FALLBACK;
3074
- }
3075
- // Obey mempool min fee when using smart fee estimation
3076
- CAmount min_mempool_fee = pool.GetMinFee (gArgs .GetArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE) * 1000000 ).GetFee (nTxBytes);
3077
- if (fee_needed < min_mempool_fee) {
3078
- fee_needed = min_mempool_fee;
3079
- if (feeCalc) feeCalc->reason = FeeReason::MEMPOOL_MIN;
3080
- }
3081
- }
3082
-
3083
- // prevent user from paying a fee below minRelayTxFee or minTxFee
3084
- CAmount required_fee = GetRequiredFee (nTxBytes);
3085
- if (required_fee > fee_needed) {
3086
- fee_needed = required_fee;
3087
- if (feeCalc) feeCalc->reason = FeeReason::REQUIRED;
3088
- }
3089
- // But always obey the maximum
3090
- if (fee_needed > maxTxFee) {
3091
- fee_needed = maxTxFee;
3092
- if (feeCalc) feeCalc->reason = FeeReason::MAXTXFEE;
3093
- }
3094
- return fee_needed;
3095
- }
3096
-
3097
-
3098
-
3099
-
3100
3024
DBErrors CWallet::LoadWallet (bool & fFirstRunRet )
3101
3025
{
3102
3026
fFirstRunRet = false ;
0 commit comments