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
This commit is contained in:
niftynei 2021-05-11 14:29:22 -05:00 committed by Rusty Russell
parent e375932108
commit c75ca8c112

View File

@ -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);