From e54c0adcedaa39874f9452a2696ab40019d6a6d1 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 14 Dec 2016 23:42:06 +0100 Subject: [PATCH] gossip: Do not consider half-open connections for routes Connections are in a half-open state after receiving the `channel_announcement` and before the `channel_update` makes them usable, so we need to ignore channels that are not yet fully open. --- daemon/routing.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/routing.c b/daemon/routing.c index ea7603494..b260c82d3 100644 --- a/daemon/routing.c +++ b/daemon/routing.c @@ -388,6 +388,8 @@ struct peer *find_route(const tal_t *ctx, n = node_map_next(dstate->nodes, &it)) { size_t num_edges = tal_count(n->in); for (i = 0; i < num_edges; i++) { + if (!n->in[i]->active) + continue; bfg_one_edge(n, i, riskfactor); log_debug(dstate->base_log, "We seek %p->%p, this is %p -> %p", dst, src, n->in[i]->src, n->in[i]->dst);