From e7f6dc3fa172b9b2f25d23781ac05b139da3576f Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 6 Aug 2019 19:07:44 -0700 Subject: [PATCH] Explicitly Send Peer Disconnected Event when Blocking --- protocol/connections/engine.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/protocol/connections/engine.go b/protocol/connections/engine.go index 2e58c62..04189ae 100644 --- a/protocol/connections/engine.go +++ b/protocol/connections/engine.go @@ -125,6 +125,10 @@ func (e *engine) eventHandler() { if connection != nil && err == nil { connection.Close() } + // Explicitly send a disconnected event (if we don't do this here then the UI can wait for a while before + // an ongoing Open() connection fails and so the user will see a blocked peer as still connecting (because + // there isn't an active connection and we are stuck waiting for tor to time out) + e.peerDisconnected(ev.Data[event.RemotePeer]) case event.ProtocolEngineStartListen: go e.listenFn() default: