From da49981ecde27f6e13b92f06c4c7cb5503306955 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Mon, 27 Feb 2017 00:07:51 +0100 Subject: [PATCH] Allow 6 failed requests before closing peer --- src/Peer/Peer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Peer/Peer.py b/src/Peer/Peer.py index 032990f6..fdafcb50 100644 --- a/src/Peer/Peer.py +++ b/src/Peer/Peer.py @@ -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