From 5aea5fff2fec0bda891ebbf88c9b8556b7ed6397 Mon Sep 17 00:00:00 2001 From: Dusty Daemon Date: Wed, 25 Oct 2023 17:35:26 -0400 Subject: [PATCH] splice[FLAKE]: stale channel announcement fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Under certain conditions, when splicing a new channel quickly enough, an old channel announcement would emit *after* `mutual_splice_lock` and *before* announcement signature exchange. Since the original channeld wouldn’t start the announcement timer until signatures were exchagned, this wasn’t an issue before. Now splicing enables us to go from having announcement sigs to losing them, so we have to be prepared for this case. Changelog-None --- channeld/channeld.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/channeld/channeld.c b/channeld/channeld.c index 4f7499c56..e98603858 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -563,6 +563,12 @@ static void announce_channel(struct peer *peer) { u8 *cannounce; + /* If we splice quickly enough, the initial channel announcement may + * still be pending. This old announcement is made stale by splicing, + * so we ommit it. */ + if (!peer->have_sigs[LOCAL] || !peer->have_sigs[REMOTE]) + return; + cannounce = create_channel_announcement(tmpctx, peer); wire_sync_write(MASTER_FD,