Skip to content

Commit

Permalink
Merge pull request #87 from gupadhyaya/not_recent_head
Browse files Browse the repository at this point in the history
returning subjective head if request to trusted peer for head fails
  • Loading branch information
gupadhyaya committed Jul 25, 2023
2 parents 87ab66e + 690e8b5 commit 6cf3094
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sync/sync_head.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func (s *Syncer[H]) Head(ctx context.Context) (H, error) {
defer s.getter.Unlock()
netHead, err := s.getter.Head(ctx)
if err != nil {
return netHead, err
log.Warnw("failed to return head from trusted peer, returning subjective head which may not be recent", "sbjHead", sbjHead.Height(), "err", err)
return sbjHead, nil
}
// process and validate netHead fetched from trusted peers
// NOTE: We could trust the netHead like we do during 'automatic subjective initialization'
Expand Down

0 comments on commit 6cf3094

Please sign in to comment.