Skip to content

Commit 084c81c

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#23547: Bugfix: RPC/mining: Fail properly in estimatesmartfee if smart fee data is unavailable
cd8d156 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 bitcoin/bitcoin@cd8d156 darosior: utACK cd8d156 kristapsk: utACK cd8d156 Tree-SHA512: eb4aa3cc345c69c44ffd5733b51b90eefe1d7854b7a2855e8cbb98268db24d43b7d0ae9fbb0eccf9b6dc01da644d19433cc77fec52ff67bf890be1fc53a67fc4
2 parents 61b82a8 + cd8d156 commit 084c81c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rpc/mining.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,10 +1121,10 @@ static RPCHelpMan estimatesmartfee()
11211121
UniValue errors(UniValue::VARR);
11221122
FeeCalculation feeCalc;
11231123
CFeeRate feeRate{fee_estimator.estimateSmartFee(conf_target, &feeCalc, conservative)};
1124-
CFeeRate min_mempool_feerate{mempool.GetMinFee(gArgs.GetIntArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000)};
1125-
CFeeRate min_relay_feerate{::minRelayTxFee};
1126-
feeRate = std::max({feeRate, min_mempool_feerate, min_relay_feerate});
11271124
if (feeRate != CFeeRate(0)) {
1125+
CFeeRate min_mempool_feerate{mempool.GetMinFee(gArgs.GetIntArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000)};
1126+
CFeeRate min_relay_feerate{::minRelayTxFee};
1127+
feeRate = std::max({feeRate, min_mempool_feerate, min_relay_feerate});
11281128
result.pushKV("feerate", ValueFromAmount(feeRate.GetFeePerK()));
11291129
} else {
11301130
errors.push_back("Insufficient data or no feerate found");

0 commit comments

Comments
 (0)