|
|
|
@ -360,10 +360,7 @@ func (e *engine) peerWithOnion(onion string) {
|
|
|
|
|
log.Debugf("Called PeerWithOnion for %v", onion)
|
|
|
|
|
if !e.isBlocked(onion) {
|
|
|
|
|
e.ignoreOnShutdown(e.peerConnecting)(onion)
|
|
|
|
|
log.Debugf("PeerWithOnion Connecting %v", onion)
|
|
|
|
|
connected, err := e.service.Connect(onion, e.createPeerTemplate())
|
|
|
|
|
|
|
|
|
|
log.Debugf("PeerWithOnion %v %v", onion, err)
|
|
|
|
|
// 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 {
|
|
|
|
@ -373,13 +370,12 @@ func (e *engine) peerWithOnion(onion string) {
|
|
|
|
|
e.ignoreOnShutdown(e.peerAuthed)(onion)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
log.Debugf("PeerWithOnion something went very wrong...%v %v", onion, err)
|
|
|
|
|
log.Errorf("PeerWithOnion something went very wrong...%v %v", onion, err)
|
|
|
|
|
if conn != nil {
|
|
|
|
|
conn.Close()
|
|
|
|
|
}
|
|
|
|
|
e.ignoreOnShutdown(e.peerDisconnected)(onion)
|
|
|
|
|
} else {
|
|
|
|
|
log.Debugf("PeerWithOnion %v %v", onion, err)
|
|
|
|
|
e.ignoreOnShutdown(e.peerDisconnected)(onion)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|