Limit peer reputation increase from tracker
This commit is contained in:
parent
f0f9b93694
commit
12d494bf38
1 changed files with 6 additions and 4 deletions
|
@ -124,10 +124,12 @@ class Peer(object):
|
||||||
|
|
||||||
# Found a peer from a source
|
# Found a peer from a source
|
||||||
def found(self, source="other"):
|
def found(self, source="other"):
|
||||||
if source == "tracker":
|
if self.reputation < 5:
|
||||||
self.reputation += 1
|
if source == "tracker":
|
||||||
elif source == "local":
|
self.reputation += 1
|
||||||
self.reputation += 3
|
elif source == "local":
|
||||||
|
self.reputation += 3
|
||||||
|
|
||||||
if source in ("tracker", "local"):
|
if source in ("tracker", "local"):
|
||||||
self.site.peers_recent.appendleft(self)
|
self.site.peers_recent.appendleft(self)
|
||||||
self.time_found = time.time()
|
self.time_found = time.time()
|
||||||
|
|
Loading…
Reference in a new issue