26 return std::max(
wallet.m_min_fee,
wallet.chain().relayMinFee());
40 feerate_needed = *(coin_control.
m_feerate);
46 feerate_needed =
wallet.m_pay_tx_fee;
58 feerate_needed =
wallet.chain().estimateSmartFee(target, conservative_estimate, feeCalc);
61 feerate_needed =
wallet.m_fallback_fee;
69 if (feerate_needed < min_mempool_feerate) {
70 feerate_needed = min_mempool_feerate;
77 if (required_feerate > feerate_needed) {
78 feerate_needed = required_feerate;
81 return feerate_needed;
86 unsigned int highest_target =
wallet.chain().estimateMaxBlocks();
87 CFeeRate discard_rate =
wallet.chain().estimateSmartFee(highest_target,
false);
89 discard_rate = (discard_rate ==
CFeeRate(0)) ?
wallet.m_discard_rate : std::min(discard_rate,
wallet.m_discard_rate);
91 discard_rate = std::max(discard_rate,
wallet.chain().relayDustFee());
int64_t CAmount
Amount in satoshis (Can be negative)
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
CAmount GetFee(uint32_t num_bytes) const
Return the fee in satoshis for the given vsize in vbytes.
FeeEstimateMode m_fee_mode
Fee estimation mode to control arguments to estimateSmartFee.
std::optional< bool > m_signal_bip125_rbf
Override the wallet's m_signal_rbf if set.
std::optional< unsigned int > m_confirm_target
Override the default confirmation target if set.
bool fOverrideFeeRate
Override automatic min/max checks on fee, m_feerate must be set if true.
std::optional< CFeeRate > m_feerate
Override the wallet's m_pay_tx_fee if set.
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
@ CONSERVATIVE
Force estimateSmartFee to use conservative estimates.
@ ECONOMICAL
Force estimateSmartFee to use non-conservative estimates.
CFeeRate GetRequiredFeeRate(const CWallet &wallet)
Return the minimum required feerate taking into account the minimum relay feerate and user set minimu...
CAmount GetMinimumFee(const CWallet &wallet, unsigned int nTxBytes, const CCoinControl &coin_control, FeeCalculation *feeCalc)
Estimate the minimum fee considering user set parameters and the required fee.
CFeeRate GetMinimumFeeRate(const CWallet &wallet, const CCoinControl &coin_control, FeeCalculation *feeCalc)
Estimate the minimum fee rate considering user set parameters and the required fee.
CFeeRate GetDiscardRate(const CWallet &wallet)
Return the maximum feerate for discarding change.
CAmount GetRequiredFee(const CWallet &wallet, unsigned int nTxBytes)
Return the minimum required absolute fee for this size based on the required fee rate.