@@ -958,7 +958,7 @@ RPCHelpMan signrawtransactionwithwallet()
958
958
}
959
959
960
960
// Definition of allowed formats of specifying transaction outputs in
961
- // `send` and `walletcreatefundedpsbt` RPCs.
961
+ // `bumpfee`, `psbtbumpfee`, ` send` and `walletcreatefundedpsbt` RPCs.
962
962
static std::vector<RPCArg> OutputsDoc ()
963
963
{
964
964
return
@@ -1013,7 +1013,12 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
1013
1013
" still be replaceable in practice, for example if it has unconfirmed ancestors which\n "
1014
1014
" are replaceable).\n " },
1015
1015
{" estimate_mode" , RPCArg::Type::STR, RPCArg::Default{" unset" }, " The fee estimate mode, must be one of (case insensitive):\n "
1016
- " \" " + FeeModes (" \"\n\" " ) + " \" " },
1016
+ " \" " + FeeModes (" \"\n\" " ) + " \" " },
1017
+ {" outputs" , RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, " New outputs (key-value pairs) which will replace\n "
1018
+ " the original ones, if provided. Each address can only appear once and there can\n "
1019
+ " only be one \" data\" object.\n " ,
1020
+ OutputsDoc (),
1021
+ RPCArgOptions{.skip_type_check = true }},
1017
1022
},
1018
1023
RPCArgOptions{.oneline_description =" options" }},
1019
1024
},
@@ -1050,6 +1055,7 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
1050
1055
coin_control.fAllowWatchOnly = pwallet->IsWalletFlagSet (WALLET_FLAG_DISABLE_PRIVATE_KEYS);
1051
1056
// optional parameters
1052
1057
coin_control.m_signal_bip125_rbf = true ;
1058
+ std::vector<CTxOut> outputs;
1053
1059
1054
1060
if (!request.params [1 ].isNull ()) {
1055
1061
UniValue options = request.params [1 ];
@@ -1060,6 +1066,7 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
1060
1066
{" fee_rate" , UniValueType ()}, // will be checked by AmountFromValue() in SetFeeEstimateMode()
1061
1067
{" replaceable" , UniValueType (UniValue::VBOOL)},
1062
1068
{" estimate_mode" , UniValueType (UniValue::VSTR)},
1069
+ {" outputs" , UniValueType ()}, // will be checked by AddOutputs()
1063
1070
},
1064
1071
true , true );
1065
1072
@@ -1073,6 +1080,16 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
1073
1080
coin_control.m_signal_bip125_rbf = options[" replaceable" ].get_bool ();
1074
1081
}
1075
1082
SetFeeEstimateMode (*pwallet, coin_control, conf_target, options[" estimate_mode" ], options[" fee_rate" ], /* override_min_fee=*/ false );
1083
+
1084
+ // Prepare new outputs by creating a temporary tx and calling AddOutputs().
1085
+ if (!options[" outputs" ].isNull ()) {
1086
+ if (options[" outputs" ].isArray () && options[" outputs" ].empty ()) {
1087
+ throw JSONRPCError (RPC_INVALID_PARAMETER, " Invalid parameter, output argument cannot be an empty array" );
1088
+ }
1089
+ CMutableTransaction tempTx;
1090
+ AddOutputs (tempTx, options[" outputs" ]);
1091
+ outputs = tempTx.vout ;
1092
+ }
1076
1093
}
1077
1094
1078
1095
// Make sure the results are valid at least up to the most recent block
@@ -1090,7 +1107,7 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
1090
1107
CMutableTransaction mtx;
1091
1108
feebumper::Result res;
1092
1109
// Targeting feerate bump.
1093
- res = feebumper::CreateRateBumpTransaction (*pwallet, hash, coin_control, errors, old_fee, new_fee, mtx, /* require_mine=*/ !want_psbt);
1110
+ res = feebumper::CreateRateBumpTransaction (*pwallet, hash, coin_control, errors, old_fee, new_fee, mtx, /* require_mine=*/ !want_psbt, outputs );
1094
1111
if (res != feebumper::Result::OK) {
1095
1112
switch (res) {
1096
1113
case feebumper::Result::INVALID_ADDRESS_OR_KEY:
0 commit comments