Refine Connection Logic

This commit is contained in:
Sarah Jamie Lewis 2023-07-13 11:48:14 -07:00
parent 77e4e981e8
commit 1e0cbe1dc6
1 changed files with 5 additions and 0 deletions

View File

@ -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 {