bitcoinconsensus: invalid flags should be set to bitcoinconsensus_error type, add test cases covering bitcoinconsensus error codes

This commit is contained in:
Thomas Kerin
2018-07-13 12:47:07 +01:00
parent 2ea7eb62b2
commit 417b6c1d29
2 changed files with 143 additions and 1 deletions

View File

@@ -81,7 +81,7 @@ static int verify_script(const unsigned char *scriptPubKey, unsigned int scriptP
unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err)
{
if (!verify_flags(flags)) {
return bitcoinconsensus_ERR_INVALID_FLAGS;
return set_error(err, bitcoinconsensus_ERR_INVALID_FLAGS);
}
try {
TxInputStream stream(SER_NETWORK, PROTOCOL_VERSION, txTo, txToLen);