signrawtransactionwithkey: report error when missing redeemScript/witnessScript param

This commit is contained in:
Anthony Towns
2019-06-20 14:02:06 +10:00
parent 413e438ea9
commit 01174596e6
2 changed files with 8 additions and 0 deletions

View File

@@ -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");
}
}
}
}