diff --git a/peer.go b/peer.go index ef198fe..ce74ea6 100644 --- a/peer.go +++ b/peer.go @@ -174,9 +174,10 @@ func (p *Peer) reconnect() { p.logger.Warn("Failed to connect to peer", slog.String(errKey, connectErr.Error())) } + ticker := time.NewTicker(reconnectInterval) for { select { - case <-time.NewTicker(reconnectInterval).C: + case <-ticker.C: if p.Connected() || p.Connecting() { continue }