Skip to content

Commit

Permalink
update pkg node controller
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-bisonai committed May 29, 2024
1 parent 48b1eef commit e322d44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node/pkg/boot/peer/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ func sync(c *fiber.Ctx) error {
}

connectionUrl := fmt.Sprintf("/ip4/%s/tcp/%d/p2p/%s", payload.Ip, payload.Port, payload.HostId)
isAlive, _ := libp2pUtils.IsHostAlive(c.Context(), h, connectionUrl)
isAlive, err := libp2pUtils.IsHostAlive(c.Context(), h, connectionUrl)
if err != nil {
log.Error().Err(err).Msg("Failed to check peer")
return c.Status(fiber.StatusInternalServerError).SendString("Failed to check peer")
}
if !isAlive {
log.Info().Str("peer", connectionUrl).Msg("invalid peer")
err = h.Close()
Expand Down

0 comments on commit e322d44

Please sign in to comment.