mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-10 15:47:17 +02:00
refactor: fees: split fee rate format from fee estimate mode
- Introduce a `FeeRateFormat` enum and change `CFeeRate::ToString()` to use it for `BTC/kvB` vs `sat/vB` output formatting. - Handle all enum values, hence remove default case in `CFeeRate::ToString()` and `assert(False)` when a `FeeRateFormat` value is not handled. - Keep `FeeEstimateMode` focused on fee estimation behavior by removing fee rate format values from `FeeEstimateMode`. - Update all formatting call sites and tests to pass `FeeRateFormat` explicitly, separating fee rate format from fee-estimation mode selection.
This commit is contained in:
@@ -1153,7 +1153,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
|
||||
// Do not, ever, assume that it's fine to change the fee rate if the user has explicitly
|
||||
// provided one
|
||||
if (coin_control.m_feerate && coin_selection_params.m_effective_feerate > *coin_control.m_feerate) {
|
||||
return util::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))};
|
||||
return util::Error{strprintf(_("Fee rate (%s) is lower than the minimum fee rate setting (%s)"), coin_control.m_feerate->ToString(FeeRateFormat::SAT_VB), coin_selection_params.m_effective_feerate.ToString(FeeRateFormat::SAT_VB))};
|
||||
}
|
||||
if (feeCalc.reason == FeeReason::FALLBACK && !wallet.m_allow_fallback_fee) {
|
||||
// eventually allow a fallback fee
|
||||
|
||||
Reference in New Issue
Block a user