Report IsValidPeginWitness error message

This commit is contained in:
Steven Roose 2019-05-07 20:13:42 +01:00
parent bb80fd1602
commit 50c557083d
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87

View file

@ -5209,7 +5209,7 @@ static UniValue createrawpegin(const JSONRPCRequest& request, T_tx_ref& txBTCRef
// We re-check depth before returning with more descriptive result
std::string err;
if (!IsValidPeginWitness(pegin_witness, mtx.vin[0].prevout, err, false)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Constructed peg-in witness is invalid.");
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Constructed peg-in witness is invalid: %s", err));
}
// Put input witness in transaction