Only return small number of peers if no new site added by the peer

This commit is contained in:
shortcutme 2018-08-26 02:47:43 +02:00
parent b7a66295f6
commit a7adb517ca
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -84,7 +84,7 @@ class FileRequestPlugin(object):
if params.get("onions") and not all_onions_signed and hashes_changed: if params.get("onions") and not all_onions_signed and hashes_changed:
back["onion_sign_this"] = "%.0f" % time.time() # Send back nonce for signing back["onion_sign_this"] = "%.0f" % time.time() # Send back nonce for signing
if len(hashes) > 500: if len(hashes) > 500 or not hashes_changed:
limit = 5 limit = 5
order = False order = False
else: else:
@ -103,7 +103,6 @@ class FileRequestPlugin(object):
peers.append(hash_peers) peers.append(hash_peers)
time_peerlist = time.time() - s time_peerlist = time.time() - s
back["peers"] = peers back["peers"] = peers
self.connection.log( self.connection.log(
"Announce %s sites (onions: %s, onion_check: %.3fs, db_onion: %.3fs, db_ip4: %.3fs, peerlist: %.3fs)" % "Announce %s sites (onions: %s, onion_check: %.3fs, db_onion: %.3fs, db_ip4: %.3fs, peerlist: %.3fs)" %