def handle_version(self, version, services, addr_to, addr_from, nonce, sub_version, mode, best_share_hash):
if self.other_version is not None:
raise PeerMisbehavingError('more than one version message')
- if version < 4:
+ if version < 8:
raise PeerMisbehavingError('peer too old')
self.other_version = version
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()