From 1e0cbe1dc603fd35d7f173f5b2bb4c7657f7f632 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Thu, 13 Jul 2023 11:48:14 -0700 Subject: [PATCH] Refine Connection Logic --- protocol/connections/engine.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/protocol/connections/engine.go b/protocol/connections/engine.go index b9b7cac..533a81a 100644 --- a/protocol/connections/engine.go +++ b/protocol/connections/engine.go @@ -362,6 +362,11 @@ func (e *engine) peerWithOnion(onion string) { if !e.isBlocked(onion) { e.ignoreOnShutdown(e.peerConnecting)(onion) connected, err := e.service.Connect(onion, e.createPeerTemplate()) + if connected && err == nil { + // on success CwtchPeer will handle Auth and other status updates + // early exit from this function... + return + } // If we are already connected...check if we are authed and issue an auth event // (This allows the ui to be stateless) if connected && err != nil {