@@ -2956,12 +2956,17 @@ void FundTransaction(CWallet* const pwallet, CMutableTransaction& tx, CAmount& f
2956
2956
{
2957
2957
{" add_inputs" , UniValueType (UniValue::VBOOL)},
2958
2958
{" changeAddress" , UniValueType (UniValue::VSTR)},
2959
+ {" change_address" , UniValueType (UniValue::VSTR)},
2959
2960
{" changePosition" , UniValueType (UniValue::VNUM)},
2961
+ {" change_position" , UniValueType (UniValue::VNUM)},
2960
2962
{" change_type" , UniValueType (UniValue::VSTR)},
2961
2963
{" includeWatching" , UniValueType (UniValue::VBOOL)},
2964
+ {" include_watching" , UniValueType (UniValue::VBOOL)},
2962
2965
{" lockUnspents" , UniValueType (UniValue::VBOOL)},
2966
+ {" lock_unspents" , UniValueType (UniValue::VBOOL)},
2963
2967
{" feeRate" , UniValueType ()}, // will be checked below
2964
2968
{" subtractFeeFromOutputs" , UniValueType (UniValue::VARR)},
2969
+ {" subtract_fee_from_outputs" , UniValueType (UniValue::VARR)},
2965
2970
{" replaceable" , UniValueType (UniValue::VBOOL)},
2966
2971
{" conf_target" , UniValueType (UniValue::VNUM)},
2967
2972
{" estimate_mode" , UniValueType (UniValue::VSTR)},
@@ -2972,22 +2977,24 @@ void FundTransaction(CWallet* const pwallet, CMutableTransaction& tx, CAmount& f
2972
2977
coinControl.m_add_inputs = options[" add_inputs" ].get_bool ();
2973
2978
}
2974
2979
2975
- if (options.exists (" changeAddress" )) {
2976
- CTxDestination dest = DecodeDestination (options[" changeAddress" ].get_str ());
2980
+ if (options.exists (" changeAddress" ) || options.exists (" change_address" )) {
2981
+ const std::string change_address_str = (options.exists (" change_address" ) ? options[" change_address" ] : options[" changeAddress" ]).get_str ();
2982
+ CTxDestination dest = DecodeDestination (change_address_str);
2977
2983
2978
2984
if (!IsValidDestination (dest)) {
2979
- throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " changeAddress must be a valid bitcoin address" );
2985
+ throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " Change address must be a valid bitcoin address" );
2980
2986
}
2981
2987
2982
2988
coinControl.destChange = dest;
2983
2989
}
2984
2990
2985
- if (options.exists (" changePosition" ))
2986
- change_position = options[" changePosition" ].get_int ();
2991
+ if (options.exists (" changePosition" ) || options.exists (" change_position" )) {
2992
+ change_position = (options.exists (" change_position" ) ? options[" change_position" ] : options[" changePosition" ]).get_int ();
2993
+ }
2987
2994
2988
2995
if (options.exists (" change_type" )) {
2989
- if (options.exists (" changeAddress" )) {
2990
- throw JSONRPCError (RPC_INVALID_PARAMETER, " Cannot specify both changeAddress and address_type options" );
2996
+ if (options.exists (" changeAddress" ) || options. exists ( " change_address " ) ) {
2997
+ throw JSONRPCError (RPC_INVALID_PARAMETER, " Cannot specify both change address and address type options" );
2991
2998
}
2992
2999
OutputType out_type;
2993
3000
if (!ParseOutputType (options[" change_type" ].get_str (), out_type)) {
@@ -2996,10 +3003,12 @@ void FundTransaction(CWallet* const pwallet, CMutableTransaction& tx, CAmount& f
2996
3003
coinControl.m_change_type .emplace (out_type);
2997
3004
}
2998
3005
2999
- coinControl.fAllowWatchOnly = ParseIncludeWatchonly (options[" includeWatching" ], *pwallet);
3006
+ const UniValue include_watching_option = options.exists (" include_watching" ) ? options[" include_watching" ] : options[" includeWatching" ];
3007
+ coinControl.fAllowWatchOnly = ParseIncludeWatchonly (include_watching_option, *pwallet);
3000
3008
3001
- if (options.exists (" lockUnspents" ))
3002
- lockUnspents = options[" lockUnspents" ].get_bool ();
3009
+ if (options.exists (" lockUnspents" ) || options.exists (" lock_unspents" )) {
3010
+ lockUnspents = (options.exists (" lock_unspents" ) ? options[" lock_unspents" ] : options[" lockUnspents" ]).get_bool ();
3011
+ }
3003
3012
3004
3013
if (options.exists (" feeRate" ))
3005
3014
{
@@ -3013,8 +3022,8 @@ void FundTransaction(CWallet* const pwallet, CMutableTransaction& tx, CAmount& f
3013
3022
coinControl.fOverrideFeeRate = true ;
3014
3023
}
3015
3024
3016
- if (options.exists (" subtractFeeFromOutputs" ))
3017
- subtractFeeFromOutputs = options[ " subtractFeeFromOutputs" ].get_array ();
3025
+ if (options.exists (" subtractFeeFromOutputs" ) || options. exists ( " subtract_fee_from_outputs " ) )
3026
+ subtractFeeFromOutputs = ( options. exists ( " subtract_fee_from_outputs " ) ? options[ " subtract_fee_from_outputs " ] : options[ " subtractFeeFromOutputs" ]) .get_array ();
3018
3027
3019
3028
if (options.exists (" replaceable" )) {
3020
3029
coinControl.m_signal_bip125_rbf = options[" replaceable" ].get_bool ();
0 commit comments