forked from cwtch.im/cwtch
Refine Connection Logic
This commit is contained in:
parent
77e4e981e8
commit
1e0cbe1dc6
|
@ -362,6 +362,11 @@ func (e *engine) peerWithOnion(onion string) {
|
||||||
if !e.isBlocked(onion) {
|
if !e.isBlocked(onion) {
|
||||||
e.ignoreOnShutdown(e.peerConnecting)(onion)
|
e.ignoreOnShutdown(e.peerConnecting)(onion)
|
||||||
connected, err := e.service.Connect(onion, e.createPeerTemplate())
|
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
|
// If we are already connected...check if we are authed and issue an auth event
|
||||||
// (This allows the ui to be stateless)
|
// (This allows the ui to be stateless)
|
||||||
if connected && err != nil {
|
if connected && err != nil {
|
||||||
|
|
Loading…
Reference in New Issue