@@ -5207,6 +5207,7 @@ static void peer_reconnect(struct peer *peer,
52075207 const u8 * * premature_msgs = tal_arr (peer , const u8 * , 0 );
52085208 struct inflight * inflight ;
52095209 struct bitcoin_txid * local_next_funding , * remote_next_funding ;
5210+ u64 send_next_commitment_number ;
52105211
52115212 struct tlv_channel_reestablish_tlvs * send_tlvs , * recv_tlvs ;
52125213
@@ -5268,6 +5269,7 @@ static void peer_reconnect(struct peer *peer,
52685269
52695270 inflight = last_inflight (peer );
52705271
5272+ send_next_commitment_number = peer -> next_index [LOCAL ];
52715273 if (inflight && (!inflight -> last_tx || !inflight -> remote_tx_sigs )) {
52725274 if (missing_user_signatures (peer ,
52735275 inflight -> i_am_initiator
@@ -5289,6 +5291,12 @@ static void peer_reconnect(struct peer *peer,
52895291 send_tlvs = tlv_channel_reestablish_tlvs_new (peer );
52905292 }
52915293 send_tlvs -> next_funding = & inflight -> outpoint .txid ;
5294+
5295+ /* Eclair wants us to decrement commitment number to
5296+ * indicate that we would like them to re-send
5297+ * commitment signatures */
5298+ /* DTODO: Add bolt reference */
5299+ send_next_commitment_number -- ;
52925300 }
52935301 }
52945302
@@ -5346,7 +5354,7 @@ static void peer_reconnect(struct peer *peer,
53465354 if (channel_has (peer -> channel , OPT_STATIC_REMOTEKEY )) {
53475355 msg = towire_channel_reestablish
53485356 (NULL , & peer -> channel_id ,
5349- peer -> next_index [ LOCAL ] ,
5357+ send_next_commitment_number ,
53505358 peer -> revocations_received ,
53515359 last_remote_per_commit_secret ,
53525360 /* Can send any (valid) point here */
@@ -5362,7 +5370,7 @@ static void peer_reconnect(struct peer *peer,
53625370 */
53635371 msg = towire_channel_reestablish
53645372 (NULL , & peer -> channel_id ,
5365- peer -> next_index [ LOCAL ] ,
5373+ send_next_commitment_number ,
53665374 peer -> revocations_received ,
53675375 last_remote_per_commit_secret ,
53685376 & my_current_per_commitment_point ,
0 commit comments