gossip: Deduplicate short_channel_id checks

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2018-01-29 23:12:41 +01:00 committed by Rusty Russell
parent e2f5e4bb3c
commit fa1806da61

View File

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