From fd8477c3be87f420632f4a62d0934c1c2f8f6660 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 4 Dec 2019 11:34:04 +0200 Subject: [PATCH] Don't update expired node if have enough nodes in that stream --- src/network/knownnodes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network/knownnodes.py b/src/network/knownnodes.py index cf7dfd22..a17fae58 100644 --- a/src/network/knownnodes.py +++ b/src/network/knownnodes.py @@ -138,6 +138,9 @@ def addKnownNode(stream, peer, lastseen=None, is_self=False): except KeyError: pass except TypeError: + # don't update expired node if have enough nodes in that stream + if len(knownNodes[stream]) > 64: + return rating = -0.2 else: return