From 674dcf9a55e76cb036bf1f37db4ed7bf356d6d90 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 7 Dec 2021 10:16:16 +0100 Subject: [PATCH] Merge bitcoin/bitcoin#23547: Bugfix: RPC/mining: Fail properly in estimatesmartfee if smart fee data is unavailable cd8d156354ed32a215de5eab5c394a1d74d91ed4 Bugfix: RPC/mining: Fail properly in estimatesmartfee if smart fee data is unavailable (Luke Dashjr) Pull request description: Fixes a regression introduced by #22722 (Not entirely sure on the solution) ACKs for top commit: prayank23: crACK https://github.com/bitcoin/bitcoin/pull/23547/commits/cd8d156354ed32a215de5eab5c394a1d74d91ed4 darosior: utACK cd8d156354ed32a215de5eab5c394a1d74d91ed4 kristapsk: utACK cd8d156354ed32a215de5eab5c394a1d74d91ed4 Tree-SHA512: eb4aa3cc345c69c44ffd5733b51b90eefe1d7854b7a2855e8cbb98268db24d43b7d0ae9fbb0eccf9b6dc01da644d19433cc77fec52ff67bf890be1fc53a67fc4 --- src/rpc/mining.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 026ceb2fc2..50956048da 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -1169,10 +1169,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.GetArg("-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.GetArg("-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");