Order more peers for connected peers simply by reputation
This commit is contained in:
parent
a5fcc7d65f
commit
b84abea670
1 changed files with 1 additions and 2 deletions
|
@ -855,10 +855,9 @@ class Site(object):
|
||||||
need_more = need_num - len(found)
|
need_more = need_num - len(found)
|
||||||
found_more = sorted(
|
found_more = sorted(
|
||||||
self.peers.values()[0:need_more * 50],
|
self.peers.values()[0:need_more * 50],
|
||||||
key=lambda peer: peer.time_found + peer.reputation * 60,
|
key=lambda peer: peer.reputation,
|
||||||
reverse=True
|
reverse=True
|
||||||
)[0:need_more * 2]
|
)[0:need_more * 2]
|
||||||
random.shuffle(found_more)
|
|
||||||
|
|
||||||
found += found_more
|
found += found_more
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue