Stop findhash if all task finished during the findhash call

This commit is contained in:
shortcutme 2017-10-03 15:52:37 +02:00
parent e85efe2c64
commit 43bd8a2d6c
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 3 additions and 0 deletions

View File

@ -296,6 +296,9 @@ class WorkerManager(object):
if len(found) < len(optional_hash_ids) or find_more:
self.log.debug("No connected hashtable result for optional files: %s" % (optional_hash_ids - set(found)))
if not self.tasks:
self.log.debug("No tasks, stopping finding optional peers")
return
# Try to query connected peers
threads = []