Order more peers for connected peers simply by reputation

This commit is contained in:
shortcutme 2018-09-02 02:23:46 +02:00
parent a5fcc7d65f
commit b84abea670
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 1 additions and 2 deletions

View File

@ -855,10 +855,9 @@ class Site(object):
need_more = need_num - len(found)
found_more = sorted(
self.peers.values()[0:need_more * 50],
key=lambda peer: peer.time_found + peer.reputation * 60,
key=lambda peer: peer.reputation,
reverse=True
)[0:need_more * 2]
random.shuffle(found_more)
found += found_more