Allow 6 failed requests before closing peer

This commit is contained in:
shortcutme 2017-02-27 00:07:51 +01:00
parent ebd00bfb9f
commit da49981ecd
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -293,7 +293,7 @@ class Peer(object):
back = {key: map(helper.unpackAddress, val) for key, val in res["peers"].items()[0:30]}
# Unpack onion
for hash, onion_peers in res.get("peers_onion", {}).items()[0:30]:
if not hash in back:
if hash not in back:
back[hash] = []
back[hash] += map(helper.unpackOnionAddress, onion_peers)
@ -327,7 +327,7 @@ class Peer(object):
# On connection error
def onConnectionError(self, reason="Unknown"):
self.connection_error += 1
if self.connection_error >= 3: # Dead peer
if self.connection_error >= 6: # Dead peer
self.remove("Peer connection: %s" % reason)
# Done working with peer