Skip to content

Commit

Permalink
refactor(sync): simplify isExpired
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg committed Jun 25, 2024
1 parent 672fc95 commit 77866f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sync/sync_head.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (s *Syncer[H]) verify(ctx context.Context, newHead H) (bool, error) {
// isExpired checks if header is expired against trusting period.
func isExpired[H header.Header[H]](header H, period time.Duration) bool {
expirationTime := header.Time().Add(period)
return !expirationTime.After(time.Now())
return expirationTime.Before(time.Now())
}

// isRecent checks if header is recent against the given recency threshold.
Expand Down

0 comments on commit 77866f6

Please sign in to comment.