From 38eb603decb08c40cf32ef62ca1876baea8d3caf Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 13 Apr 2021 14:53:26 -0700 Subject: [PATCH] Fix Dialer issues on Restart --- tor/torProvider.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tor/torProvider.go b/tor/torProvider.go index 2bce6d5..3f3a311 100644 --- a/tor/torProvider.go +++ b/tor/torProvider.go @@ -236,7 +236,10 @@ func (tp *torProvider) restart() { log.Debugf("Restarting Tor Process") newTp, err := startTor(tp.appDirectory, tp.bundeledTorPath, tp.controlPort, tp.authenticator) if err == nil { + // we need to reassign tor, dialer and callback which will have changed by swapping out + // the underlying connection. tp.t = newTp.t + tp.dialer = newTp.dialer tp.statusCallback = statusCallback tp.lastRestartTime = time.Now() go tp.monitorRestart()