diff --git a/client/internal/peer/conn.go b/client/internal/peer/conn.go index 4fbc0c8dc..07ff850fc 100644 --- a/client/internal/peer/conn.go +++ b/client/internal/peer/conn.go @@ -188,18 +188,23 @@ func (conn *Conn) Open() { conn.log.Warnf("error while updating the state err: %v", err) } + go conn.startHandshakeAndReconnect() +} + +func (conn *Conn) startHandshakeAndReconnect() { conn.waitInitialRandomSleepTime() - err = conn.handshaker.sendOffer() + err := conn.handshaker.sendOffer() if err != nil { - conn.log.Errorf("failed to send offer: %v", err) + conn.log.Errorf("failed to send initial offer: %v", err) } if conn.workerRelay.IsController() { - go conn.reconnectLoopWithRetry() + conn.reconnectLoopWithRetry() } else { - go conn.reconnectLoopForOnDisconnectedEvent() + conn.reconnectLoopForOnDisconnectedEvent() } + } // Close closes this peer Conn issuing a close event to the Conn closeCh diff --git a/client/internal/peer/status.go b/client/internal/peer/status.go index 57accd28d..44b6083a6 100644 --- a/client/internal/peer/status.go +++ b/client/internal/peer/status.go @@ -705,7 +705,6 @@ func (d *Status) GetFullStatus() FullStatus { } fullStatus.Peers = append(fullStatus.Peers, d.offlinePeers...) - return fullStatus }