You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #16377: [rpc] don't automatically append inputs in walletcreatefundedpsbt
e5327f9 [rpc] fundrawtransaction: add_inputs option to control automatic input adding (Sjors Provoost)
79804fe [rpc] walletcreatefundedpsbt: don't automatically append inputs (Sjors Provoost)
Pull request description:
When the user doesn't specificy inputs, it makes sense to automatically select them. But when the user does specify inputs, `walletcreatefundedpsbt` now fails if the amount is insufficient, unless `addInputs` is set to `true`.
Similarly for `fundrawtransaction` if the original transaction already specified inputs, we only add more if `addInputs` is set to `true`.
This protects against fat finger mistakes in the amount or fee rate (see also #16257). The behavior is also more similar to GUI coin selection.
ACKs for top commit:
achow101:
ACK e5327f9
meshcollider:
utACK e5327f9
Tree-SHA512: d8653b820914396c7c25b0d0a2b7e92de214aa023bc1aa085feb37d3b20fab361ebea90416a7db989f19bdc37e26cf0adfbcb712c80985c87afa67a9bd44fecb
{"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of the raw transaction"},
3055
3059
{"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}",
3056
3060
{
3061
+
{"add_inputs", RPCArg::Type::BOOL, /* default */"true", "For a transaction with existing inputs, automatically include more if they are not enough."},
3057
3062
{"changeAddress", RPCArg::Type::STR, /* default */"pool address", "The bitcoin address to receive the change"},
3058
3063
{"changePosition", RPCArg::Type::NUM, /* default */"random", "The index of the change output"},
3059
3064
{"change_type", RPCArg::Type::STR, /* default */"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, /* default */"false", "If inputs are specified, automatically include more if they are not enough."},
4013
4022
{"changeAddress", RPCArg::Type::STR_HEX, /* default */"pool address", "The bitcoin address to receive the change"},
4014
4023
{"changePosition", RPCArg::Type::NUM, /* default */"random", "The index of the change output"},
4015
4024
{"change_type", RPCArg::Type::STR, /* default */"set by -changetype", "The output type to use. Only valid if changeAddress is not specified. Options are \"legacy\", \"p2sh-segwit\", and \"bech32\"."},
0 commit comments