don't connect to old peers. should reduce bandwidth used
[p2pool.git] / p2pool / util / p2protocol.py
index 979a10f..e3f83a2 100644 (file)
@@ -76,7 +76,8 @@ class Protocol(protocol.Protocol):
                 print 'no handler for', repr(command)
             return
         
-        handler(**payload2)
+        if getattr(self, 'connected', True) and not getattr(self, 'disconnecting', False):
+            handler(**payload2)
     
     def badPeerHappened(self):
         self.transport.loseConnection()