reenabled bad peer banning. no longer ban for arbitrary exceptions, though
authorForrest Voight <forrest@forre.st>
Fri, 12 Oct 2012 20:20:48 +0000 (16:20 -0400)
committerForrest Voight <forrest@forre.st>
Sun, 14 Oct 2012 17:22:58 +0000 (13:22 -0400)
p2pool/p2p.py
p2pool/util/p2protocol.py

index 8a184af..fd73a89 100644 (file)
@@ -70,12 +70,10 @@ class Protocol(p2protocol.Protocol):
                 raise PeerMisbehavingError('first message was not version message')
             p2protocol.Protocol.packetReceived(self, command, payload2)
         except PeerMisbehavingError, e:
-            return
             print 'Peer %s:%i misbehaving, will drop and ban. Reason:' % self.addr, e.message
             self.badPeerHappened()
     
     def badPeerHappened(self):
-        return
         if p2pool.DEBUG:
             print "Bad peer banned:", self.addr
         self.transport.loseConnection()
index 433d79a..979a10f 100644 (file)
@@ -67,7 +67,7 @@ class Protocol(protocol.Protocol):
             except:
                 print 'RECV', command, payload[:100].encode('hex') + ('...' if len(payload) > 100 else '')
                 log.err(None, 'Error handling message: (see RECV line)')
-                self.badPeerHappened()
+                self.transport.loseConnection()
     
     def packetReceived(self, command, payload2):
         handler = getattr(self, 'handle_' + command, None)