From ec5d4efa9c901a3db4432b6f63fd079194a757f2 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 4f7499c56c60..e98603858529 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,