24 return min_fee_rate.
fee_rate.
GetFee(
static_cast<int32_t
>(nTxBytes));
29 return std::max(
wallet.m_min_fee,
wallet.chain().relayMinFee());
46 if (required_feerate > fee_rate)
return {required_feerate,
FeeReason::REQUIRED, std::nullopt};
57 conservative_estimate =
true;
59 conservative_estimate =
false;
61 const auto fee_estimation_res =
wallet.chain().getFeeRateEstimate(target, conservative_estimate);
63 CFeeRate fee_rate{estimation.feerate};
66 std::optional<int> returned_target{estimation.returned_target};
69 fee_rate =
wallet.m_fallback_fee;
71 returned_target = std::nullopt;
78 if (fee_rate < min_mempool_feerate) {
79 fee_rate = min_mempool_feerate;
81 returned_target = std::nullopt;
85 if (required_feerate > fee_rate)
return {required_feerate,
FeeReason::REQUIRED, std::nullopt};
87 return {fee_rate, fee_reason, returned_target};
92 unsigned int highest_target =
wallet.chain().maximumFeeEstimationTargetBlocks();
93 const auto res =
wallet.chain().getFeeRateEstimate(highest_target,
false);
96 discard_rate = (discard_rate ==
CFeeRate(0)) ?
wallet.m_discard_rate : std::min(discard_rate,
wallet.m_discard_rate);
98 discard_rate = std::max(discard_rate,
wallet.chain().relayDustFee());
int64_t CAmount
Amount in satoshis (Can be negative)
Fee rate in satoshis per virtualbyte: CAmount / vB the feerate is represented internally as FeeFrac.
CAmount GetFee(int32_t virtual_bytes) const
Return the fee in satoshis for the given vsize in vbytes.
FeeEstimateMode m_fee_mode
Fee estimation mode.
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 fee rate if set.
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
CFeeRate GetRequiredFeeRate(const CWallet &wallet)
Return the minimum required feerate taking into account the minimum relay feerate and user set minimu...
MinimumFeeRateResult GetMinimumFeeRate(const CWallet &wallet, const CCoinControl &coin_control)
Estimate the minimum fee rate considering user set parameters and the required fee.
CAmount GetMinimumFee(const MinimumFeeRateResult &min_fee_rate, unsigned int nTxBytes)
Return the minimum fee for this size given a fee rate result.
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.
A successful fee rate estimate returned by a fee rate estimator.
const FeeRateEstimation & FeeRateEstimationRef(const util::Expected< FeeRateEstimation, FeeRateEstimationError > &result LIFETIMEBOUND)
Return the estimation carried by a fee rate estimate result: the successful estimation,...
@ CONSERVATIVE
Force Fee rate estimator to return conservative estimates.
@ ECONOMICAL
Force Fee rate estimator to return non-conservative estimates.