aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-04-27 11:04:10 +0200
committerJon Atack <jon@atack.com>2021-05-09 12:50:02 +0200
commit06a90fa0381c790f7bde2ab9bf47d2b22acef4a5 (patch)
tree0791ce660a9700afec5b85184483f1e7d3003a50 /src/wallet/rpcwallet.cpp
parent0742c7840f03505597fd2de87db97f12597ef667 (diff)
downloadbitcoin-06a90fa0381c790f7bde2ab9bf47d2b22acef4a5.tar.xz
rpc: for sat/vB fee rates, limit ParseFixedPoint decimals to 3
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 67d9d56133..31b90374bd 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -216,7 +216,8 @@ static void SetFeeEstimateMode(const CWallet& wallet, CCoinControl& cc, const Un
if (!estimate_mode.isNull() && estimate_mode.get_str() != "unset") {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot specify both estimate_mode and fee_rate");
}
- cc.m_feerate = CFeeRate(AmountFromValue(fee_rate), COIN);
+ // Fee rates in sat/vB cannot represent more than 3 significant digits.
+ cc.m_feerate = CFeeRate{AmountFromValue(fee_rate, /* decimals */ 3)};
if (override_min_fee) cc.fOverrideFeeRate = true;
// Default RBF to true for explicit fee_rate, if unset.
if (!cc.m_signal_bip125_rbf) cc.m_signal_bip125_rbf = true;