From e03b11d66e2de5093ddb7fdbd833d3324c6da84c Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Tue, 5 Sep 2023 20:55:00 +0300 Subject: [PATCH] Skip TLS also for incoming connections using tor --- minode/connection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/minode/connection.py b/minode/connection.py index 42e1501..d2ecc12 100644 --- a/minode/connection.py +++ b/minode/connection.py @@ -265,6 +265,7 @@ class ConnectionBase(threading.Thread): if ( # NODE_SSL self.remote_version.services & 2 and self.network == 'ip' and not self.host.endswith('.onion') + and not (self.server and shared.tor) ): self._do_tls_handshake() @@ -415,7 +416,9 @@ class ConnectionBase(threading.Thread): shared.services, version.host, shared.listening_port)) if self.server: if self.network == 'ip': - self.send_queue.put(message.Version(self.host, self.port)) + version_kwargs = {'services': 1} if shared.tor else {} + self.send_queue.put(message.Version( + self.host, self.port, **version_kwargs)) else: self.send_queue.put(message.Version('127.0.0.1', 7656))