From a0724f45afdbfc8eff01b7070df85ec3e39cf2ec Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 4 Dec 2017 17:46:50 +0100 Subject: [PATCH] routing: Do not set an empty channel_announcement if none is given Signed-off-by: Christian Decker --- gossipd/routing.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gossipd/routing.c b/gossipd/routing.c index 15deb76bc..3911569ca 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -424,9 +424,11 @@ static bool add_channel_direction(struct routing_state *rstate, c = half_add_connection(rstate, from, to, short_channel_id, direction); /* Remember the announcement so we can forward it to new peers */ - tal_free(c->channel_announcement); - c->channel_announcement = tal_dup_arr(c, u8, announcement, - tal_count(announcement), 0); + if (announcement) { + tal_free(c->channel_announcement); + c->channel_announcement = tal_dup_arr(c, u8, announcement, + tal_count(announcement), 0); + } return true; }