Don't update expired node if have enough nodes in that stream

This commit is contained in:
Dmitri Bogomolov 2019-12-04 11:34:04 +02:00
parent 7558f74ab6
commit d968a7b99b
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -136,6 +136,9 @@ def addKnownNode(stream, peer, lastseen=None, is_self=False):
except KeyError: except KeyError:
pass pass
except TypeError: except TypeError:
# don't update expired node if have enough nodes in that stream
if len(knownNodes[stream]) > 64:
return
rating = -0.2 rating = -0.2
else: else:
return return