An invalid witness counts as error of the verifier.
@@ -70,7 +70,8 @@ def getWitnessResult(witness, verification_result):
if status_from_validation == status_from_verification:
return (status_from_validation, category_from_validation)
# An invalid witness counts as error of the verifier.
- #return ('witness invalid (' + status + ')', Result.CATEGORY_ERROR)
+ if status_from_validation == 'ERROR (invalid witness file)':
+ return ('witness invalid (' + status_from_verification + ')', Result.CATEGORY_ERROR)
# Other unconfirmed witnesses count as CATEGORY_CORRECT_UNCONFIRMED.
if category_from_verification == Result.CATEGORY_CORRECT:
return (status_from_verification, Result.CATEGORY_CORRECT_UNCONFIRMED)
@@ -126,7 +127,8 @@ def main(argv=None):
if (
categoryWit is None or
not categoryWit.startswith(Result.CATEGORY_CORRECT) or
- categoryWitNew == Result.CATEGORY_CORRECT
+ categoryWitNew == Result.CATEGORY_CORRECT or
+ statusWitNew.startswith('witness invalid')
):
statusWit, categoryWit = (statusWitNew, categoryWitNew)
# Overwrite status with status from witness
