aboutsummaryrefslogtreecommitdiff
path: root/src/policy/feerate.cpp
diff options
context:
space:
mode:
authorKarl-Johan Alm <karljohan-alm@garage.co.jp>2020-03-04 11:28:08 +0900
committerKarl-Johan Alm <karljohan-alm@garage.co.jp>2020-06-24 16:01:38 +0900
commit3404c1b753432c4859a4ca245f01c240610a00cb (patch)
tree73e03650bd8590c2bba4e2c8c97680f6807192e8 /src/policy/feerate.cpp
parent6fcf4484302d13bd7739b617470d8c8e31974908 (diff)
downloadbitcoin-3404c1b753432c4859a4ca245f01c240610a00cb.tar.xz
policy: optional FeeEstimateMode param to CFeeRate::ToString
Diffstat (limited to 'src/policy/feerate.cpp')
-rw-r--r--src/policy/feerate.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/policy/feerate.cpp b/src/policy/feerate.cpp
index 00c5c32eb3..a01e259731 100644
--- a/src/policy/feerate.cpp
+++ b/src/policy/feerate.cpp
@@ -35,7 +35,10 @@ CAmount CFeeRate::GetFee(size_t nBytes_) const
return nFee;
}
-std::string CFeeRate::ToString() const
+std::string CFeeRate::ToString(const FeeEstimateMode& fee_estimate_mode) const
{
- return strprintf("%d.%08d %s/kB", nSatoshisPerK / COIN, nSatoshisPerK % COIN, CURRENCY_UNIT);
+ 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);
+ }
}