Skip to content

Commit 7a7c6ae

Browse files
committed
splice: Decrement next_commitment_number for Eclair
Eclair requires `next_commitment_number` to be decremented to resend the individual splice commitment_signed message.
1 parent c475214 commit 7a7c6ae

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

channeld/channeld.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5195,6 +5195,7 @@ static void peer_reconnect(struct peer *peer,
51955195
const u8 **premature_msgs = tal_arr(peer, const u8 *, 0);
51965196
struct inflight *inflight;
51975197
struct bitcoin_txid *local_next_funding, *remote_next_funding;
5198+
u64 send_next_commitment_number;
51985199

51995200
struct tlv_channel_reestablish_tlvs *send_tlvs, *recv_tlvs;
52005201

@@ -5254,6 +5255,7 @@ static void peer_reconnect(struct peer *peer,
52545255

52555256
inflight = last_inflight(peer);
52565257

5258+
send_next_commitment_number = peer->next_index[LOCAL];
52575259
if (inflight && (!inflight->last_tx || !inflight->remote_tx_sigs)) {
52585260
if (missing_user_signatures(peer,
52595261
inflight->i_am_initiator
@@ -5275,6 +5277,12 @@ static void peer_reconnect(struct peer *peer,
52755277
send_tlvs = tlv_channel_reestablish_tlvs_new(peer);
52765278
}
52775279
send_tlvs->next_funding = &inflight->outpoint.txid;
5280+
5281+
/* Eclair wants us to decrement commitment number to
5282+
* indicate that we would like them to re-send
5283+
* commitment signatures */
5284+
/* DTODO: Add bolt reference */
5285+
send_next_commitment_number--;
52785286
}
52795287
}
52805288

@@ -5324,7 +5332,7 @@ static void peer_reconnect(struct peer *peer,
53245332
if (channel_has(peer->channel, OPT_STATIC_REMOTEKEY)) {
53255333
msg = towire_channel_reestablish
53265334
(NULL, &peer->channel_id,
5327-
peer->next_index[LOCAL],
5335+
send_next_commitment_number,
53285336
peer->revocations_received,
53295337
last_remote_per_commit_secret,
53305338
/* Can send any (valid) point here */
@@ -5340,7 +5348,7 @@ static void peer_reconnect(struct peer *peer,
53405348
*/
53415349
msg = towire_channel_reestablish
53425350
(NULL, &peer->channel_id,
5343-
peer->next_index[LOCAL],
5351+
send_next_commitment_number,
53445352
peer->revocations_received,
53455353
last_remote_per_commit_secret,
53465354
&my_current_per_commitment_point,

0 commit comments

Comments
 (0)