Skip to content

Commit

Permalink
test localhead fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganesha Upadhyaya authored and Ganesha Upadhyaya committed May 31, 2023
1 parent d53efbd commit 473a448
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/gateway/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ func (h *Handler) performGetHeaderRequest(
writeError(w, http.StatusInternalServerError, heightAvailabilityEndpoint, err)
return nil, err
}
if headHeight := int(head.Height()); headHeight < height {
if localHead := int(head.Height()); height <= localHead+1 {
err = fmt.Errorf(
"current head local chain head: %d is lower than requested height: %d"+
" give header sync some time and retry later", headHeight, height)
" give header sync some time and retry later", localHead, height)
writeError(w, http.StatusServiceUnavailable, endpoint, err)
return nil, err
}
Expand Down

0 comments on commit 473a448

Please sign in to comment.