mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +02:00
wallet: update fee rate units, use sat/vB for fee_rate error messages
and BTC/kvB for feeRate error messages.
This commit is contained in:
@@ -38,7 +38,7 @@ CAmount CFeeRate::GetFee(size_t nBytes_) const
|
||||
std::string CFeeRate::ToString(const FeeEstimateMode& fee_estimate_mode) const
|
||||
{
|
||||
switch (fee_estimate_mode) {
|
||||
case FeeEstimateMode::SAT_B: return strprintf("%d.%03d %s/B", nSatoshisPerK / 1000, nSatoshisPerK % 1000, CURRENCY_ATOM);
|
||||
default: return strprintf("%d.%08d %s/kB", nSatoshisPerK / COIN, nSatoshisPerK % COIN, CURRENCY_UNIT);
|
||||
case FeeEstimateMode::SAT_VB: return strprintf("%d.%03d %s/vB", nSatoshisPerK / 1000, nSatoshisPerK % 1000, CURRENCY_ATOM);
|
||||
default: return strprintf("%d.%08d %s/kvB", nSatoshisPerK / COIN, nSatoshisPerK % COIN, CURRENCY_UNIT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ enum class FeeEstimateMode {
|
||||
UNSET, //!< Use default settings based on other criteria
|
||||
ECONOMICAL, //!< Force estimateSmartFee to use non-conservative estimates
|
||||
CONSERVATIVE, //!< Force estimateSmartFee to use conservative estimates
|
||||
BTC_KB, //!< Use explicit BTC/kB fee given in coin control
|
||||
SAT_B, //!< Use explicit sat/B fee given in coin control
|
||||
BTC_KVB, //!< Use BTC/kvB fee rate unit
|
||||
SAT_VB, //!< Use sat/vB fee rate unit
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; }
|
||||
friend bool operator!=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK != b.nSatoshisPerK; }
|
||||
CFeeRate& operator+=(const CFeeRate& a) { nSatoshisPerK += a.nSatoshisPerK; return *this; }
|
||||
std::string ToString(const FeeEstimateMode& fee_estimate_mode = FeeEstimateMode::BTC_KB) const;
|
||||
std::string ToString(const FeeEstimateMode& fee_estimate_mode = FeeEstimateMode::BTC_KVB) const;
|
||||
|
||||
SERIALIZE_METHODS(CFeeRate, obj) { READWRITE(obj.nSatoshisPerK); }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user