mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-08 14:47:31 +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:
@@ -4,11 +4,11 @@
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <common/messages.h>
|
||||
|
||||
#include <common/types.h>
|
||||
#include <policy/fees/block_policy_estimator.h>
|
||||
#include <node/types.h>
|
||||
#include <policy/fees/block_policy_estimator.h>
|
||||
#include <tinyformat.h>
|
||||
#include <util/fees.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/string.h>
|
||||
#include <util/translation.h>
|
||||
@@ -68,7 +68,6 @@ std::string FeeModeInfo(const std::pair<std::string, FeeEstimateMode>& mode, std
|
||||
"less responsive to short-term drops in the prevailing fee market. This mode\n"
|
||||
"potentially returns a higher fee rate estimate.\n", mode.first);
|
||||
default:
|
||||
// Other modes apart from the ones handled are fee rate units; they should not be clarified.
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user