aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony Towns <[email protected]>2019-06-20 21:36:45 +1000
committerAnthony Towns <[email protected]>2019-07-05 14:45:04 +1000
commit1dc357dabbd843da02d15316c55d63c566414069 (patch)
tree19521d4709f7340c41d927062244773ef4afd86b /src
parentMerge #16035: 0.18.1: Backports (diff)
downloaddiscoin-1dc357dabbd843da02d15316c55d63c566414069.tar.xz
discoin-1dc357dabbd843da02d15316c55d63c566414069.zip
signrawtransactionwithkey: report error when missing redeemScript/witnessScript param
Github-Pull: #16250 Rebased-From: 01174596e69568c434198a86f54cb9ea6740e6c2
Diffstat (limited to 'src')
-rw-r--r--src/rpc/rawtransaction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index ae4fed285..c79ac45b0 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");
+ }
}
}
}