mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 22:31:48 +01:00
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:
parent
985d0db143
commit
5aea5fff2f
1 changed files with 6 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue