Skip to content

Commit 0b52099

Browse files
committed
splice: Resume splice_locked on reestablish
A new case where `splice_locked` must be sent again on reestablish. This handles the case where `splice_locked` did not complete locally or remotely and must be resumed.
1 parent d3816db commit 0b52099

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

channeld/channeld.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5177,6 +5177,25 @@ static void peer_reconnect(struct peer *peer,
51775177
true,
51785178
false,
51795179
true);
5180+
} else if (inflight->is_locked
5181+
&& bitcoin_txid_eq(remote_next_funding,
5182+
&inflight->outpoint.txid)) {
5183+
if (!bitcoin_txid_eq(&inflight->outpoint.txid,
5184+
&peer->splice_state->locked_txid))
5185+
peer_failed_err(peer->pps,
5186+
&peer->channel_id,
5187+
"Invalid splice was resumed %s,"
5188+
" should be %s",
5189+
fmt_bitcoin_txid(tmpctx,
5190+
&inflight->outpoint.txid),
5191+
fmt_bitcoin_txid(tmpctx,
5192+
&peer->splice_state->locked_txid));
5193+
status_info("Splice is not confirmed but locked on"
5194+
" chain -- resending splice_locked");
5195+
peer_write(peer->pps,
5196+
take(towire_splice_locked(NULL,
5197+
&peer->channel_id)));
5198+
peer->splice_state->locked_ready[LOCAL] = true;
51805199
} else if (bitcoin_txid_eq(remote_next_funding,
51815200
&inflight->outpoint.txid)) {
51825201
/* Don't send sigs unless we have theirs */

0 commit comments

Comments
 (0)