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
parent 3108115570
commit 448e9e2f36
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

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