splice[FLAKE]: stale channel announcement fix

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
This commit is contained in:
Dusty Daemon 2023-10-25 17:35:26 -04:00 committed by Rusty Russell
parent 985d0db143
commit 5aea5fff2f

View file

@ -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,