From 00d4c04208a6e7ec6145a377ba4d77aeda59802c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 18 May 2018 15:19:14 +0930 Subject: [PATCH] channeld: fix conditions under which we can send a channel update. The condition in send_channel_update is wrong: it needs to match the conditions under which we send announcements. Signed-off-by: Rusty Russell --- channeld/channel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/channeld/channel.c b/channeld/channel.c index 7c8a4a475..e7659580c 100644 --- a/channeld/channel.c +++ b/channeld/channel.c @@ -349,9 +349,9 @@ static void send_channel_update(struct peer *peer, bool peer_too, assert(disable_flag == 0 || disable_flag == ROUTING_FLAGS_DISABLED); - /* If we don't have funding_locked both sides, we can't have told - * gossipd or created update. */ - if (!peer->funding_locked[LOCAL] || !peer->funding_locked[REMOTE]) + /* Only send an update if we sent a temporary or real announcement */ + if (!peer->sent_temporary_announce + && !(peer->have_sigs[LOCAL] && peer->have_sigs[REMOTE])) return; msg = create_channel_update(tmpctx, peer, disable_flag); @@ -508,8 +508,8 @@ static void channel_announcement_negotiate(struct peer *peer) * a local update */ if (!peer->announce_depth_reached) { if (!peer->sent_temporary_announce) { - send_temporary_announcement(peer); peer->sent_temporary_announce = true; + send_temporary_announcement(peer); } return; }