@@ -2314,7 +2314,7 @@ static struct commitsig_info *handle_peer_commit_sig_batch(struct peer *peer,
2314
2314
enum peer_wire type ;
2315
2315
struct tlv_commitment_signed_tlvs * cs_tlv
2316
2316
= tlv_commitment_signed_tlvs_new (tmpctx );
2317
- status_info ("fromwire_commitment_signed(%p) primary" , msg );
2317
+ status_debug ("fromwire_commitment_signed(%p) primary" , msg );
2318
2318
if (!fromwire_commitment_signed (tmpctx , msg ,
2319
2319
& channel_id , & commit_sig .s , & raw_sigs ,
2320
2320
& cs_tlv ))
@@ -5339,7 +5339,8 @@ static void peer_reconnect(struct peer *peer,
5339
5339
bool dataloss_protect , check_extra_fields ;
5340
5340
const u8 * * premature_msgs = tal_arr (peer , const u8 * , 0 );
5341
5341
struct inflight * inflight ;
5342
- struct bitcoin_txid * local_next_funding , * remote_next_funding ;
5342
+ struct bitcoin_txid * local_next_funding , * remote_next_funding ,
5343
+ * remote_your_last_funding ;
5343
5344
u64 send_next_commitment_number ;
5344
5345
5345
5346
struct tlv_channel_reestablish_tlvs * send_tlvs , * recv_tlvs ;
@@ -5636,10 +5637,14 @@ static void peer_reconnect(struct peer *peer,
5636
5637
& inflight -> outpoint .txid ));
5637
5638
}
5638
5639
} else if (remote_next_funding ) { /* No current inflight */
5640
+ /* If our peer is trying to negotiate details about a splice
5641
+ * that is already onchain, jump ahead to sending splice_lock */
5639
5642
if (bitcoin_txid_eq (remote_next_funding ,
5640
5643
& peer -> channel -> funding .txid )) {
5641
5644
status_info ("We have no pending splice but peer"
5642
- " expects one; resending splice_lock" );
5645
+ " is negotiating one; resending"
5646
+ " splice_lock %s" ,
5647
+ fmt_bitcoin_outpoint (tmpctx , & peer -> channel -> funding ));
5643
5648
peer_write (peer -> pps ,
5644
5649
take (towire_splice_locked (NULL ,
5645
5650
& peer -> channel_id ,
@@ -5657,13 +5662,43 @@ static void peer_reconnect(struct peer *peer,
5657
5662
if (!itr -> locked_scid )
5658
5663
continue ;
5659
5664
5665
+ status_info ("Resending splice_locked because an inflight %s is"
5666
+ " locked" ,
5667
+ fmt_bitcoin_outpoint (tmpctx , & itr -> outpoint ));
5660
5668
peer_write (peer -> pps ,
5661
5669
take (towire_splice_locked (NULL ,
5662
5670
& peer -> channel_id ,
5663
5671
& itr -> outpoint .txid )));
5664
5672
peer -> splice_state -> locked_ready [LOCAL ] = true;
5665
5673
}
5666
5674
5675
+ /* If no inflight, no splice negotiation, but
5676
+ `your_last_funding_locked_txid is stale, re-send `splice_locked`. */
5677
+ if (!inflight && !remote_next_funding
5678
+ && feature_negotiated (peer -> our_features , peer -> their_features ,
5679
+ OPT_SPLICE )) {
5680
+ remote_your_last_funding = recv_tlvs
5681
+ ? recv_tlvs -> your_last_funding_locked_txid : NULL ;
5682
+ if (remote_your_last_funding
5683
+ && !bitcoin_txid_eq (& peer -> channel -> funding .txid ,
5684
+ remote_your_last_funding )) {
5685
+ status_info ("Resending splice_locked with no inflight,"
5686
+ " no splice negotation, but we did recv"
5687
+ " remote_your_last_funding value of %s"
5688
+ " instead of %s. Our sent splice_locked"
5689
+ " value is %s." ,
5690
+ remote_your_last_funding
5691
+ ? fmt_bitcoin_txid (tmpctx , remote_your_last_funding )
5692
+ : "NULL" ,
5693
+ fmt_bitcoin_outpoint (tmpctx , & peer -> channel -> funding ),
5694
+ fmt_bitcoin_txid (tmpctx , & peer -> channel -> funding .txid ));
5695
+ peer_write (peer -> pps ,
5696
+ take (towire_splice_locked (NULL ,
5697
+ & peer -> channel_id ,
5698
+ & peer -> channel -> funding .txid )));
5699
+ }
5700
+ }
5701
+
5667
5702
/* BOLT #2:
5668
5703
*
5669
5704
* - if `next_commitment_number` is 1 in both the
0 commit comments