From c75ca8c1121739f3d7c2e39fa816d0839801e194 Mon Sep 17 00:00:00 2001 From: niftynei Date: Tue, 11 May 2021 14:29:22 -0500 Subject: [PATCH] df-bugs: if we've already got the funding_locked, dont renotify Peer sends funding locked, we tell lightningd who saves it to disk. Then we restart/reconnect and they retransmit funding_locked. We were re-notifying lightningd about their lock-in, which was crashing/breaking things. Instead, we ignore duplicate lock-in messages from the peer. lightningd-1: 2021-05-11T18:00:12.844Z **BROKEN** 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-chan#1: Internal error DUALOPEND_AWAITING_LOCKIN: channel_got_funding_locked twice --- openingd/dualopend.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openingd/dualopend.c b/openingd/dualopend.c index bd7fc2e80..640c8ebf2 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -1112,13 +1112,15 @@ static u8 *handle_funding_locked(struct state *state, u8 *msg) tal_hex(msg, msg)); } - state->funding_locked[REMOTE] = true; - billboard_update(state); - /* We save when the peer locks, so we do the right * thing on reconnects */ - msg = towire_dualopend_peer_locked(NULL, &remote_per_commit); - wire_sync_write(REQ_FD, take(msg)); + if (!state->funding_locked[REMOTE]) { + msg = towire_dualopend_peer_locked(NULL, &remote_per_commit); + wire_sync_write(REQ_FD, take(msg)); + } + + state->funding_locked[REMOTE] = true; + billboard_update(state); if (state->funding_locked[LOCAL]) return towire_dualopend_channel_locked(state, state->pps);