From 01174596e69568c434198a86f54cb9ea6740e6c2 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Thu, 20 Jun 2019 14:02:06 +1000 Subject: signrawtransactionwithkey: report error when missing redeemScript/witnessScript param --- src/rpc/rawtransaction_util.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/rpc/rawtransaction_util.cpp') 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"); + } } } } -- cgit v1.2.3