Prevent adding bootstrap servers to knownnodes when received in addr

This commit is contained in:
Dmitri Bogomolov 2020-11-09 12:09:16 +02:00 committed by Muzahid
parent 3feea1ee3f
commit f23487a155
Signed by untrusted user: cis-muzahid
GPG Key ID: 1DC85E7D3AB613EA

View File

@ -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