aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/rawtransaction_util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/rawtransaction_util.cpp')
-rw-r--r--src/rpc/rawtransaction_util.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rpc/rawtransaction_util.cpp b/src/rpc/rawtransaction_util.cpp
index 9c4cdc3a90..69ed7ffcbb 100644
--- a/src/rpc/rawtransaction_util.cpp
+++ b/src/rpc/rawtransaction_util.cpp
@@ -11,7 +11,7 @@
#include <keystore.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
-#include <rpc/protocol.h>
+#include <rpc/request.h>
#include <rpc/util.h>
#include <tinyformat.h>
#include <univalue.h>
@@ -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");
+ }
}
}
}