From f23487a15516236a613d19340a23ce835ad36567 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Mon, 9 Nov 2020 12:09:16 +0200 Subject: [PATCH] Prevent adding bootstrap servers to knownnodes when received in addr --- src/network/bmproto.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/network/bmproto.py b/src/network/bmproto.py index ef64de94..20cbb8e6 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -437,9 +437,14 @@ class BMProto(AdvancedDispatcher, ObjectTracker): # pylint: disable=redefined-outer-name addresses = self._decode_addr() for seenTime, stream, _, ip, port in addresses: - decodedIP = protocol.checkIPAddress(str(ip)) - if stream not in state.streamsInWhichIAmParticipating: + ip = str(ip) + if ( + stream not in state.streamsInWhichIAmParticipating + # FIXME: should check against complete list + or ip.startswith('bootstrap') + ): continue + decodedIP = protocol.checkIPAddress(ip) if ( decodedIP and time.time() - seenTime > 0