Merge branch 'master' of gitorious.org:electrum/server
[electrum-server.git] / stratum.py
index cd3a431..d91b7d1 100644 (file)
@@ -70,6 +70,7 @@ class Session:
         self.lock = threading.Lock()
         self.numblocks_sub = None
         self.addresses_sub = {}
+        print "new session", address
 
     def stop(self):
         self._connection.close()
@@ -110,8 +111,8 @@ class TcpResponder(threading.Thread):
             # Possible race condition here by having session
             # close connection?
             # I assume Python connections are thread safe interfaces
-            connection = session.connection()
             try:
+                connection = session.connection()
                 connection.send(raw_response + "\n")
             except:
                 session.stop()
@@ -128,7 +129,6 @@ class TcpClientRequestor(threading.Thread):
     def run(self):
         while not self.shared.stopped():
             if not self.update():
-                self.session.stop()
                 break
 
             while self.parse():
@@ -230,7 +230,7 @@ class Stratum:
         processor.shared = shared
         processor.start()
         # Create various transports we need
-        transports = TcpServer(shared, processor, "ecdsa.org", 50002),
+        transports = TcpServer(shared, processor, "176.31.24.241", 50001),
         for server in transports:
             server.start()
         while not shared.stopped():