Skip to content

Commit

Permalink
report known headersr as soft failure
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Dec 19, 2023
1 parent 28ff21c commit 454a329
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ func Verify[H Header[H]](trstd, untrstd H, heightThreshold uint64) error {
// general mandatory verification
err := verify[H](trstd, untrstd, heightThreshold)
if err != nil {
return &VerifyError{Reason: err}
verErr := &VerifyError{Reason: err}
if errors.Is(err, ErrKnownHeader) {
// if known, header is not *really* wrong, just already known and we can ignore it
verErr.SoftFailure = true
}
return verErr
}
// user defined verification
err = trstd.Verify(untrstd)
Expand Down

0 comments on commit 454a329

Please sign in to comment.