Add reputation for old peers

This commit is contained in:
shortcutme 2017-02-27 00:06:13 +01:00
parent 06ddf26d09
commit e80887d779
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 3 additions and 1 deletions

View file

@ -46,6 +46,7 @@ class ContentDbPlugin(object):
peer.hashfield.replaceFromString(row["hashfield"])
num_hashfield += 1
peer.time_added = row["time_added"]
peer.reputation = int((time.time() - peer.time_added) / (60 * 60 * 24)) # Older peers has more reputation
num += 1
site.log.debug("%s peers (%s with hashfield) loaded in %.3fs" % (num, num_hashfield, time.time() - s))