Skip to content

Commit 454a329

Browse files
committed
report known headersr as soft failure
1 parent 28ff21c commit 454a329

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

verify.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ func Verify[H Header[H]](trstd, untrstd H, heightThreshold uint64) error {
1919
// general mandatory verification
2020
err := verify[H](trstd, untrstd, heightThreshold)
2121
if err != nil {
22-
return &VerifyError{Reason: err}
22+
verErr := &VerifyError{Reason: err}
23+
if errors.Is(err, ErrKnownHeader) {
24+
// if known, header is not *really* wrong, just already known and we can ignore it
25+
verErr.SoftFailure = true
26+
}
27+
return verErr
2328
}
2429
// user defined verification
2530
err = trstd.Verify(untrstd)

0 commit comments

Comments
 (0)