Skip to content

Commit

Permalink
fix: use chain origin when no intersect points are specified
Browse files Browse the repository at this point in the history
  • Loading branch information
agaffney committed Jul 14, 2023
1 parent 4e6a58d commit 9003055
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions protocol/chainsync/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ func (c *Client) GetAvailableBlockRange(intersectPoints []common.Point) (common.
func (c *Client) Sync(intersectPoints []common.Point) error {
c.busyMutex.Lock()
defer c.busyMutex.Unlock()
// Use origin if no intersect points were specified
if len(intersectPoints) == 0 {
intersectPoints = []common.Point{common.NewPointOrigin()}
}
msg := NewMsgFindIntersect(intersectPoints)
if err := c.SendMessage(msg); err != nil {
return err
Expand Down

0 comments on commit 9003055

Please sign in to comment.