diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-08-21 08:59:35 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-08-21 09:44:26 +0200 |
commit | 8aa9badf5ea3ea98980f50d924e88e46c4d5ee38 (patch) | |
tree | b96ab86c1c66db8b4b49d92a510e1f353b040f2f /src/rpc | |
parent | 4732fa133abdf374790825abbf1bbf56819cc806 (diff) | |
parent | faaac5caaab4d5131040292f4ef2404074ad268b (diff) |
Merge #13968: [wallet] couple of walletcreatefundedpsbt fixes
faaac5caaab4d5131040292f4ef2404074ad268b RPCTypeCheck bip32derivs arg in walletcreatefunded (Gregory Sanders)
1f0c4282e961baea85d5f74d7493bd7459784391 QA: add basic walletcreatefunded optional arg test (Gregory Sanders)
1f18d7b591ffcc8bb9422a9b728bd9a0d8da6a2a walletcreatefundedpsbt: remove duplicate replaceable arg (Gregory Sanders)
2252ec50085c151e7998ca9a30cda6a33ee862b6 Allow ConstructTransaction to not throw error with 0-input txn (Gregory Sanders)
Pull request description:
1) Previously an empty input argument transaction that is marked for replaceability fails to pass the `SignalsOptInRBF` check right before funding it. Explicitly check for that condition before throwing an error.
2) The rpc call had two separate `replaceable` arguments, each of which being used in mutually exclusive places. I preserved the `options` version to retain compatability with `fundtransaction`.
Tree-SHA512: 26eb0c9e2d38ea51d11f741d61100223253271a084adadeb7e78c6d4e9004636f089e4273c5bf64a41bd7e9ff795317acf30531cb36aeb0d8db9304b3c8270c3
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/client.cpp | 5 | ||||
-rw-r--r-- | src/rpc/rawtransaction.cpp | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp index 6738b206c9..c7f3e38ac0 100644 --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -113,9 +113,8 @@ static const CRPCConvertParam vRPCConvertParams[] = { "walletcreatefundedpsbt", 0, "inputs" }, { "walletcreatefundedpsbt", 1, "outputs" }, { "walletcreatefundedpsbt", 2, "locktime" }, - { "walletcreatefundedpsbt", 3, "replaceable" }, - { "walletcreatefundedpsbt", 4, "options" }, - { "walletcreatefundedpsbt", 5, "bip32derivs" }, + { "walletcreatefundedpsbt", 3, "options" }, + { "walletcreatefundedpsbt", 4, "bip32derivs" }, { "walletprocesspsbt", 1, "sign" }, { "walletprocesspsbt", 3, "bip32derivs" }, { "createpsbt", 0, "inputs" }, diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 608a1b5da2..314184ab06 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -436,7 +436,7 @@ CMutableTransaction ConstructTransaction(const UniValue& inputs_in, const UniVal } } - if (!rbf.isNull() && rbfOptIn != SignalsOptInRBF(rawTx)) { + if (!rbf.isNull() && rawTx.vin.size() > 0 && rbfOptIn != SignalsOptInRBF(rawTx)) { throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter combination: Sequence number(s) contradict replaceable option"); } |