Skip to content

Commit b36523d

Browse files
authored
fix: error check getting tip (#289)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 518fd83 commit b36523d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

internal/utxorpc/sync.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,13 @@ func (s *chainSyncServiceServer) FollowTip(
194194
point = ocommon.NewPoint(slot, blockHash)
195195
}
196196
} else {
197-
tip, _ := oConn.ChainSync().Client.GetCurrentTip()
198-
point = tip.Point
197+
tip, err := oConn.ChainSync().Client.GetCurrentTip()
198+
if err != nil {
199+
return fmt.Errorf("failed to get tip: %s", err)
200+
}
201+
if tip != nil {
202+
point = tip.Point
203+
}
199204
}
200205

201206
// Start the sync with the node

0 commit comments

Comments
 (0)