Allow RPC users to opt-in to unsafe inputs when funding a raw transaction.
Applications that need to manage a complex RBF flow (such as lightning
nodes using anchor outputs) are very limited if they can only use safe inputs.
Fixes#21299
{"options",RPCArg::Type::OBJ,RPCArg::Optional::OMITTED_NAMED_ARG,"for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}",
{
{"add_inputs",RPCArg::Type::BOOL,RPCArg::Default{true},"For a transaction with existing inputs, automatically include more if they are not enough."},
{"include_unsafe",RPCArg::Type::BOOL,RPCArg::Default{false},"Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n"
"Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n"
"If that happens, you will need to fund the transaction with different inputs and republish it."},
{"changeAddress",RPCArg::Type::STR,RPCArg::DefaultHint{"pool address"},"The bitcoin address to receive the change"},
{"changePosition",RPCArg::Type::NUM,RPCArg::DefaultHint{"random"},"The index of the change output"},
{"change_type",RPCArg::Type::STR,RPCArg::DefaultHint{"set by -changetype"},"The output type to use. Only valid if changeAddress is not specified. Options are \"legacy\", \"p2sh-segwit\", and \"bech32\"."},
{"add_inputs",RPCArg::Type::BOOL,RPCArg::Default{false},"If inputs are specified, automatically include more if they are not enough."},
{"include_unsafe",RPCArg::Type::BOOL,RPCArg::Default{false},"Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n"
"Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n"
"If that happens, you will need to fund the transaction with different inputs and republish it."},
{"add_to_wallet",RPCArg::Type::BOOL,RPCArg::Default{true},"When false, returns a serialized transaction which will not be added to the wallet or broadcast"},
{"change_address",RPCArg::Type::STR_HEX,RPCArg::DefaultHint{"pool address"},"The bitcoin address to receive the change"},
{"change_position",RPCArg::Type::NUM,RPCArg::DefaultHint{"random"},"The index of the change output"},
{"add_inputs",RPCArg::Type::BOOL,RPCArg::Default{false},"If inputs are specified, automatically include more if they are not enough."},
{"include_unsafe",RPCArg::Type::BOOL,RPCArg::Default{false},"Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n"
"Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n"
"If that happens, you will need to fund the transaction with different inputs and republish it."},
{"changeAddress",RPCArg::Type::STR_HEX,RPCArg::DefaultHint{"pool address"},"The bitcoin address to receive the change"},
{"changePosition",RPCArg::Type::NUM,RPCArg::DefaultHint{"random"},"The index of the change output"},
{"change_type",RPCArg::Type::STR,RPCArg::DefaultHint{"set by -changetype"},"The output type to use. Only valid if changeAddress is not specified. Options are \"legacy\", \"p2sh-segwit\", and \"bech32\"."},