From fbe3a017a9285b05dc9d03ee428c774348c95d67 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 7 Aug 2017 13:10:10 +0200 Subject: [PATCH] gossip: Fix crash of getroute if we don't know any channels This happens when we either have no channel open, or didn't announce the channel. This patch just fails the getroute request. I'll later add the non-broadcast announcement for local channels that should fix this for unannounced channels. --- daemon/routing.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/routing.c b/daemon/routing.c index d7a5c4a94..4101e66e5 100644 --- a/daemon/routing.c +++ b/daemon/routing.c @@ -371,6 +371,10 @@ find_route(const tal_t *ctx, struct routing_state *rstate, log_info_struct(rstate->base_log, "find_route: cannot find %s", struct pubkey, to); return NULL; + } else if (!dst) { + log_info_struct(rstate->base_log, "find_route: cannot find myself (%s)", + struct pubkey, to); + return NULL; } else if (dst == src) { log_info_struct(rstate->base_log, "find_route: this is %s, refusing to create empty route", struct pubkey, to);