@@ -3290,7 +3290,7 @@ static UniValue bumpfee(const JSONRPCRequest& request)
3290
3290
" The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n "
3291
3291
" By default, the new fee will be calculated automatically using estimatesmartfee.\n "
3292
3292
" The user can specify a confirmation target for estimatesmartfee.\n "
3293
- " Alternatively, the user can specify totalFee (DEPRECATED), or use RPC settxfee to set a higher fee rate .\n "
3293
+ " Alternatively, the user can specify totalFee (DEPRECATED), or fee_rate ( " + CURRENCY_UNIT + " per kB) for the new transaction .\n "
3294
3294
" At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\n "
3295
3295
" returned by getnetworkinfo) to enter the node's mempool.\n " ,
3296
3296
{
@@ -3302,6 +3302,9 @@ static UniValue bumpfee(const JSONRPCRequest& request)
3302
3302
" In rare cases, the actual fee paid might be slightly higher than the specified\n "
3303
3303
" totalFee if the tx change output has to be removed because it is too close to\n "
3304
3304
" the dust threshold." },
3305
+ {" fee_rate" , RPCArg::Type::NUM, /* default */ " fallback to 'confTarget'" , " FeeRate (NOT total fee) to pay, in " + CURRENCY_UNIT + " per kB\n "
3306
+ " Specify a fee rate instead of relying on the built-in fee estimator.\n "
3307
+ " Must be at least 0.0001 BTC per kB higher than the current transaction fee rate.\n " },
3305
3308
{" replaceable" , RPCArg::Type::BOOL, /* default */ " true" , " Whether the new transaction should still be\n "
3306
3309
" marked bip-125 replaceable. If true, the sequence numbers in the transaction will\n "
3307
3310
" be left unchanged from the original. If false, any input sequence numbers in the\n "
@@ -3343,13 +3346,15 @@ static UniValue bumpfee(const JSONRPCRequest& request)
3343
3346
{
3344
3347
{" confTarget" , UniValueType (UniValue::VNUM)},
3345
3348
{" totalFee" , UniValueType (UniValue::VNUM)},
3349
+ {" fee_rate" , UniValueType (UniValue::VNUM)},
3346
3350
{" replaceable" , UniValueType (UniValue::VBOOL)},
3347
3351
{" estimate_mode" , UniValueType (UniValue::VSTR)},
3348
3352
},
3349
3353
true , true );
3350
-
3351
- if (options.exists (" confTarget" ) && options.exists (" totalFee" )) {
3352
- throw JSONRPCError (RPC_INVALID_PARAMETER, " confTarget and totalFee options should not both be set. Please provide either a confirmation target for fee estimation or an explicit total fee for the transaction." );
3354
+ if (options.exists (" confTarget" ) && (options.exists (" totalFee" ) || options.exists (" fee_rate" ))) {
3355
+ throw JSONRPCError (RPC_INVALID_PARAMETER, " confTarget can't be set with totalFee or fee_rate. Please provide either a confirmation target in blocks for automatic fee estimation, or an explicit fee rate." );
3356
+ } else if (options.exists (" fee_rate" ) && options.exists (" totalFee" )) {
3357
+ throw JSONRPCError (RPC_INVALID_PARAMETER, " fee_rate can't be set along with totalFee." );
3353
3358
} else if (options.exists (" confTarget" )) { // TODO: alias this to conf_target
3354
3359
coin_control.m_confirm_target = ParseConfirmTarget (options[" confTarget" ], pwallet->chain ().estimateMaxBlocks ());
3355
3360
} else if (options.exists (" totalFee" )) {
@@ -3360,6 +3365,12 @@ static UniValue bumpfee(const JSONRPCRequest& request)
3360
3365
if (totalFee <= 0 ) {
3361
3366
throw JSONRPCError (RPC_INVALID_PARAMETER, strprintf (" Invalid totalFee %s (must be greater than 0)" , FormatMoney (totalFee)));
3362
3367
}
3368
+ } else if (options.exists (" fee_rate" )) {
3369
+ CFeeRate fee_rate (AmountFromValue (options[" fee_rate" ]));
3370
+ if (fee_rate <= 0 ) {
3371
+ throw JSONRPCError (RPC_INVALID_PARAMETER, strprintf (" Invalid fee_rate %s (must be greater than 0)" , fee_rate.ToString ()));
3372
+ }
3373
+ coin_control.m_feerate = fee_rate;
3363
3374
}
3364
3375
3365
3376
if (options.exists (" replaceable" )) {
0 commit comments