fixed "peer too old" warning message, which previously was displayed as "peer sent...
authorForrest Voight <forrest@forre.st>
Fri, 16 Mar 2012 03:27:00 +0000 (23:27 -0400)
committerForrest Voight <forrest@forre.st>
Fri, 16 Mar 2012 17:49:58 +0000 (13:49 -0400)
p2pool/p2p.py

index 1d862e2..e823864 100644 (file)
@@ -105,8 +105,10 @@ class Protocol(bitcoin_p2p.BaseProtocol):
         ('best_share_hash', pack.PossiblyNoneType(0, pack.IntType(256))),
     ])
     def handle_version(self, version, services, addr_to, addr_from, nonce, sub_version, mode, best_share_hash):
-        if self.other_version is not None or version < 2:
+        if self.other_version is not None:
             raise PeerMisbehavingError('more than one version message')
+        if version < 2:
+            raise PeerMisbehavingError('peer too old')
         
         self.other_version = version
         self.other_sub_version = sub_version[:512]