From b028a363d85b3c85c9c9d236311b97e860a73258 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 1 May 2018 20:18:04 +0200 Subject: [PATCH] gossip: Make sure we never add a channel twice Signed-off-by: Christian Decker --- gossipd/routing.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gossipd/routing.c b/gossipd/routing.c index 3d2ef944e..d0d6032fc 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -210,6 +210,9 @@ struct chan *new_chan(struct routing_state *rstate, size_t n; struct node *n1, *n2; + /* We should never add a channel twice */ + assert(!uintmap_get(&rstate->chanmap, scid->u64)); + /* Create nodes on demand */ n1 = get_node(rstate, id1); if (!n1)