Limit peer reputation increase from tracker

This commit is contained in:
shortcutme 2018-09-04 15:43:20 +02:00
parent f0f9b93694
commit 12d494bf38
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -124,10 +124,12 @@ class Peer(object):
# Found a peer from a source
def found(self, source="other"):
if source == "tracker":
self.reputation += 1
elif source == "local":
self.reputation += 3
if self.reputation < 5:
if source == "tracker":
self.reputation += 1
elif source == "local":
self.reputation += 3
if source in ("tracker", "local"):
self.site.peers_recent.appendleft(self)
self.time_found = time.time()