From b6c0c955c5cf2ef110b41748f1ad3013f7b099f8 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Fri, 18 Aug 2017 14:45:48 +0200 Subject: [PATCH] Limit bootstrap queries to 1s --- plugins/disabled-Bootstrapper/BootstrapperPlugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/disabled-Bootstrapper/BootstrapperPlugin.py b/plugins/disabled-Bootstrapper/BootstrapperPlugin.py index e6d42863..2d398d92 100644 --- a/plugins/disabled-Bootstrapper/BootstrapperPlugin.py +++ b/plugins/disabled-Bootstrapper/BootstrapperPlugin.py @@ -85,6 +85,10 @@ class FileRequestPlugin(object): back["onion_sign_this"] = "%.0f" % time.time() # Send back nonce for signing for hash in hashes: + if time.time() - time_started > 1: # 1 sec limit on request + self.connection.log("Announce time limit exceeded after %s/%s sites" % (len(peers), len(hashes))) + break + hash_peers = db.peerList( hash, ip4=self.connection.ip, onions=params.get("onions"), port=params["port"],