diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2021-11-18 18:33:41 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2021-11-18 18:35:45 +0000 |
commit | cd8d156354ed32a215de5eab5c394a1d74d91ed4 (patch) | |
tree | 2282b4de5ab4586ba282c6e2669a54e1dcaafa21 | |
parent | ea31caf6b4c182c6f10f136548f84e603800511c (diff) | |
download | bitcoin-cd8d156354ed32a215de5eab5c394a1d74d91ed4.tar.xz |
Bugfix: RPC/mining: Fail properly in estimatesmartfee if smart fee data is unavailable
-rw-r--r-- | src/rpc/mining.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 066a60b71b..f3311b1293 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -1121,10 +1121,10 @@ static RPCHelpMan estimatesmartfee() UniValue errors(UniValue::VARR); FeeCalculation feeCalc; CFeeRate feeRate{fee_estimator.estimateSmartFee(conf_target, &feeCalc, conservative)}; - CFeeRate min_mempool_feerate{mempool.GetMinFee(gArgs.GetIntArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000)}; - CFeeRate min_relay_feerate{::minRelayTxFee}; - feeRate = std::max({feeRate, min_mempool_feerate, min_relay_feerate}); if (feeRate != CFeeRate(0)) { + CFeeRate min_mempool_feerate{mempool.GetMinFee(gArgs.GetIntArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000)}; + CFeeRate min_relay_feerate{::minRelayTxFee}; + feeRate = std::max({feeRate, min_mempool_feerate, min_relay_feerate}); result.pushKV("feerate", ValueFromAmount(feeRate.GetFeePerK())); } else { errors.push_back("Insufficient data or no feerate found"); |