Skip to content

Commit

Permalink
splice[FLAKE]: stale channel announcement fix
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ddustin authored and rustyrussell committed Oct 26, 2023
1 parent 985d0db commit 5aea5ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5aea5ff

Please sign in to comment.