Prefer connecting to non-onion peers

This commit is contained in:
shortcutme 2019-11-25 14:30:51 +01:00
parent 89e8fd3d3a
commit c21fe3d23a
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 13 additions and 8 deletions

View file

@ -130,7 +130,10 @@ class Peer(object):
def found(self, source="other"):
if self.reputation < 5:
if source == "tracker":
self.reputation += 1
if self.ip.endswith(".onion"):
self.reputation += 1
else:
self.reputation += 2
elif source == "local":
self.reputation += 3