aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/rawtransaction_util.cpp
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2019-06-20 14:02:06 +1000
committerAnthony Towns <aj@erisian.com.au>2019-06-25 12:37:08 +1000
commit01174596e69568c434198a86f54cb9ea6740e6c2 (patch)
treeff3e12d9d2a1532cd280fa3b6602ac9c07434ef4 /src/rpc/rawtransaction_util.cpp
parent413e438ea9767710d4810c4400fd1242ca52cd1c (diff)
downloadbitcoin-01174596e69568c434198a86f54cb9ea6740e6c2.tar.xz
signrawtransactionwithkey: report error when missing redeemScript/witnessScript param
Diffstat (limited to 'src/rpc/rawtransaction_util.cpp')
-rw-r--r--src/rpc/rawtransaction_util.cpp3
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");
+ }
}
}
}