diff --git a/lbrynet/conf.py b/lbrynet/conf.py index da5e1381b..14fa45b53 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -291,7 +291,7 @@ ADJUSTABLE_SETTINGS = { 'run_reflector_server': (bool, False), 'sd_download_timeout': (int, 3), 'share_usage_data': (bool, True), # whether to share usage stats and diagnostic info with LBRY - 'peer_search_timeout': (int, 3), + 'peer_search_timeout': (int, 30), 'use_auth_http': (bool, False), 'use_upnp': (bool, True), 'use_keyring': (bool, False), diff --git a/lbrynet/dht/peerfinder.py b/lbrynet/dht/peerfinder.py index 5d4b073c8..3b51f7a4e 100644 --- a/lbrynet/dht/peerfinder.py +++ b/lbrynet/dht/peerfinder.py @@ -4,6 +4,7 @@ import logging from zope.interface import implements from twisted.internet import defer from lbrynet.interfaces import IPeerFinder +from lbrynet import conf log = logging.getLogger(__name__) @@ -43,12 +44,14 @@ class DHTPeerFinder(DummyPeerFinder): """ bin_hash = binascii.unhexlify(blob_hash) finished_deferred = self.dht_node.iterativeFindValue(bin_hash) + timeout = timeout or conf.settings['peer_search_timeout'] if timeout: finished_deferred.addTimeout(timeout, self.dht_node.clock) try: peer_list = yield finished_deferred except defer.TimeoutError: - log.warning("DHT timed out while looking peers for blob {}".format(blob_hash)) + log.warning("DHT timed out while looking peers for blob" + " %s after %s seconds.", blob_hash, timeout) peer_list = [] peers = set(peer_list)