server: start tor controller if we should listen for inbound connections

over Tor

In this commit, we fix a small bug where we would attempt to start the
Tor controller even if we were not requested to automatically create and
onion service in order to listen for inbound connections over Tor.
This commit is contained in:
Wilmer Paulino 2018-09-14 13:37:18 -07:00
parent 3b2c807288
commit fb059ddaa5
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

@ -432,7 +432,7 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB, cc *chainControl,
// If we were requested to route connections through Tor and to
// automatically create an onion service, we'll initiate our Tor
// controller and establish a connection to the Tor server.
if cfg.Tor.Active {
if cfg.Tor.Active && (cfg.Tor.V2 || cfg.Tor.V3) {
s.torController = tor.NewController(cfg.Tor.Control)
}