From 28eba07b3e8c1c0a9cda0222f054ef4780656bcf Mon Sep 17 00:00:00 2001 From: ErikEk Date: Sat, 18 Apr 2020 19:29:14 +0200 Subject: [PATCH] tor: socks and control can not use the same host:port --- config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config.go b/config.go index 6816b0e8..ab9d8a4a 100644 --- a/config.go +++ b/config.go @@ -663,6 +663,14 @@ func loadConfig() (*config, error) { } cfg.Tor.Control = control.String() + // Ensure that tor socks host:port is not equal to tor control + // host:port. This would lead to lnd not starting up properly. + if cfg.Tor.SOCKS == cfg.Tor.Control { + str := "%s: tor.socks and tor.control can not use " + + "the same host:port" + return nil, fmt.Errorf(str, funcName) + } + switch { case cfg.Tor.V2 && cfg.Tor.V3: return nil, errors.New("either tor.v2 or tor.v3 can be set, " +