diff --git a/peershandler.py b/peershandler.py index 53cc7f5..5fb16e4 100644 --- a/peershandler.py +++ b/peershandler.py @@ -304,6 +304,7 @@ def peersync(self, subdata: str) -> int: try: # check if node is active s_purge = socks.socksocket() + s_purge.settimeout(5) if self.config.tor: s_purge.setproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050) s_purge.connect((pair[0], int(pair[1]))) @@ -340,6 +341,7 @@ def peersync(self, subdata: str) -> int: self.app_log.info(f"Outbound: {ip}:{port} is a new peer, saving if connectible") try: s_purge = socks.socksocket() + s_purge.settimeout(5) if self.config.tor: s_purge.setproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050) s_purge.connect((ip, int(port))) # save a new peer file with only active nodes