From fa1806da619d95ea745eb90d08d4bfc178d4a615 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 29 Jan 2018 23:12:41 +0100 Subject: [PATCH] gossip: Deduplicate short_channel_id checks Signed-off-by: Christian Decker --- gossipd/routing.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gossipd/routing.c b/gossipd/routing.c index 1a505cc7f..768bfbb32 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -618,6 +618,11 @@ const struct short_channel_id *handle_channel_announcement( tal_free(tag); /* FIXME: Handle duplicates as per BOLT #7 */ + + if (find_pending_cannouncement(rstate, &pending->short_channel_id) != NULL) { + /* Drop it like it's hot */ + return tal_free(pending); + } list_add_tail(&rstate->pending_cannouncement, &pending->list); return &pending->short_channel_id; }