From 4f020cfad1f70e49e69eed731dd24ba34ef54da9 Mon Sep 17 00:00:00 2001 From: Diego Date: Sun, 16 Apr 2017 21:02:34 +0200 Subject: [PATCH] Handle connection exceptions in dht --- magneticod/magneticod/dht.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/magneticod/magneticod/dht.py b/magneticod/magneticod/dht.py index dffefb9..1359c83 100644 --- a/magneticod/magneticod/dht.py +++ b/magneticod/magneticod/dht.py @@ -72,6 +72,10 @@ class SybilNode: data = buffer.tobytes() except BlockingIOError: break + except ConnectionResetError: + continue + except ConnectionRefusedError: + continue # Ignore nodes that uses port 0 (assholes). if addr[1] == 0: