add session before the requestor is started
[electrum-server.git] / transports / stratum_tcp.py
index 85fc8b7..8f0c936 100644 (file)
@@ -123,11 +123,8 @@ class TcpServer(threading.Thread):
         sock.listen(1)
         while not self.shared.stopped():
             session = TcpSession(*sock.accept())
-            client_req = TcpClientRequestor(self.dispatcher, session)
-            client_req.start()
             self.dispatcher.add_session(session)
             self.dispatcher.collect_garbage()
-
-
-
+            client_req = TcpClientRequestor(self.dispatcher, session)
+            client_req.start()