lnrouter: ignore duplicate channel announcement

This commit is contained in:
Janus 2018-07-17 15:23:55 +02:00 committed by ThomasV
parent 9897e41e68
commit 12a02a8a1e

View file

@ -114,6 +114,9 @@ class ChannelDB(PrintError):
short_channel_id = msg_payload['short_channel_id']
#self.print_error('channel announcement', binascii.hexlify(short_channel_id).decode("ascii"))
channel_info = ChannelInfo(msg_payload)
if short_channel_id in self._id_to_channel_info:
self.print_error("IGNORING CHANNEL ANNOUNCEMENT, WE ALREADY KNOW THIS CHANNEL")
return
self._id_to_channel_info[short_channel_id] = channel_info
self._channels_for_node[channel_info.node_id_1].add(short_channel_id)
self._channels_for_node[channel_info.node_id_2].add(short_channel_id)