diff options
author | Anthony Towns <aj@erisian.com.au> | 2019-06-20 14:02:06 +1000 |
---|---|---|
committer | Anthony Towns <aj@erisian.com.au> | 2019-06-25 12:37:08 +1000 |
commit | 01174596e69568c434198a86f54cb9ea6740e6c2 (patch) | |
tree | ff3e12d9d2a1532cd280fa3b6602ac9c07434ef4 /src | |
parent | 413e438ea9767710d4810c4400fd1242ca52cd1c (diff) | |
download | bitcoin-01174596e69568c434198a86f54cb9ea6740e6c2.tar.xz |
signrawtransactionwithkey: report error when missing redeemScript/witnessScript param
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/rawtransaction_util.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rpc/rawtransaction_util.cpp b/src/rpc/rawtransaction_util.cpp index 9c4cdc3a90..14fcb628eb 100644 --- a/src/rpc/rawtransaction_util.cpp +++ b/src/rpc/rawtransaction_util.cpp @@ -221,6 +221,9 @@ UniValue SignTransaction(CMutableTransaction& mtx, const UniValue& prevTxsUnival // Automatically also add the P2WSH wrapped version of the script (to deal with P2SH-P2WSH). keystore->AddCScript(GetScriptForWitness(witnessScript)); } + if (rs.isNull() && ws.isNull()) { + throw JSONRPCError(RPC_INVALID_PARAMETER, "Missing redeemScript/witnessScript"); + } } } } |