0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

[fees]: change estimatesmartfee default mode to economical

This commit is contained in:
ismaelsadeeq 2024-06-12 14:08:18 +01:00
parent b27afb7fb7
commit 41a2545046

View file

@ -36,7 +36,7 @@ static RPCHelpMan estimatesmartfee()
"in BIP 141 (witness data is discounted).\n", "in BIP 141 (witness data is discounted).\n",
{ {
{"conf_target", RPCArg::Type::NUM, RPCArg::Optional::NO, "Confirmation target in blocks (1 - 1008)"}, {"conf_target", RPCArg::Type::NUM, RPCArg::Optional::NO, "Confirmation target in blocks (1 - 1008)"},
{"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"conservative"}, "The fee estimate mode.\n" {"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"economical"}, "The fee estimate mode.\n"
"Whether to return a more conservative estimate which also satisfies\n" "Whether to return a more conservative estimate which also satisfies\n"
"a longer history. A conservative estimate potentially returns a\n" "a longer history. A conservative estimate potentially returns a\n"
"higher feerate and is more likely to be sufficient for the desired\n" "higher feerate and is more likely to be sufficient for the desired\n"
@ -71,13 +71,13 @@ static RPCHelpMan estimatesmartfee()
CHECK_NONFATAL(mempool.m_opts.signals)->SyncWithValidationInterfaceQueue(); CHECK_NONFATAL(mempool.m_opts.signals)->SyncWithValidationInterfaceQueue();
unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE); unsigned int max_target = fee_estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);
unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target); unsigned int conf_target = ParseConfirmTarget(request.params[0], max_target);
bool conservative = true; bool conservative = false;
if (!request.params[1].isNull()) { if (!request.params[1].isNull()) {
FeeEstimateMode fee_mode; FeeEstimateMode fee_mode;
if (!FeeModeFromString(request.params[1].get_str(), fee_mode)) { if (!FeeModeFromString(request.params[1].get_str(), fee_mode)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, InvalidEstimateModeErrorMessage()); throw JSONRPCError(RPC_INVALID_PARAMETER, InvalidEstimateModeErrorMessage());
} }
if (fee_mode == FeeEstimateMode::ECONOMICAL) conservative = false; if (fee_mode == FeeEstimateMode::CONSERVATIVE) conservative = true;
} }
UniValue result(UniValue::VOBJ); UniValue result(UniValue::VOBJ);