[bitcoin/bitcoin] [wallet] couple of walletcreatefundedpsbt fixes (#13968)

achow101 commented on this pull request.

Note that the first commit also effects `createrawtransaction`.

> @@ -4715,10 +4714,16 @@ UniValue walletcreatefundedpsbt(const JSONRPCRequest& request)
}, true
);

+

Nit: miscellaneous whitespace change

> CAmount fee;
int change_position;
CMutableTransaction rawTx = ConstructTransaction(request.params[0], request.params[1], request.params[2], request.params[3]);
— FundTransaction(pwallet, rawTx, fee, change_position, request.params[4]);
+ // Make a copy and edit replaceability in-place
+ UniValue params_copy(request.params);

I don’t think this is correct. The parameters for these options are in `request.params[4]` but what you are doing here is adding it to `request.params` so when `replaceable` is looked up in `params_copy[4]`, it won’t be there.

Добавить комментарий