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