From 1dc357dabbd843da02d15316c55d63c566414069 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Thu, 20 Jun 2019 21:36:45 +1000 Subject: signrawtransactionwithkey: report error when missing redeemScript/witnessScript param Github-Pull: #16250 Rebased-From: 01174596e69568c434198a86f54cb9ea6740e6c2 --- src/rpc/rawtransaction.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index ae4fed285a..c79ac45b01 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -886,6 +886,9 @@ UniValue SignTransaction(interfaces::Chain& chain, CMutableTransaction& mtx, con // 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