@@ -1135,7 +1135,8 @@ static u8 *send_commit_part(const tal_t *ctx,
11351135 s64 remote_splice_amnt ,
11361136 u64 remote_index ,
11371137 const struct pubkey * remote_per_commit ,
1138- struct local_anchor_info * * anchor )
1138+ struct local_anchor_info * * anchor ,
1139+ u16 batch_size )
11391140{
11401141 u8 * msg ;
11411142 struct bitcoin_signature commit_sig , * htlc_sigs ;
@@ -1159,8 +1160,11 @@ static u8 *send_commit_part(const tal_t *ctx,
11591160 (int )splice_amnt , (int )remote_splice_amnt ,
11601161 remote_index );
11611162
1162- cs_tlv -> splice_info = tal (cs_tlv , struct channel_id );
1163- derive_channel_id (cs_tlv -> splice_info , funding );
1163+ cs_tlv -> splice_info = tal (cs_tlv ,
1164+ struct tlv_commitment_signed_tlvs_splice_info );
1165+
1166+ cs_tlv -> splice_info -> batch_size = batch_size ;
1167+ derive_channel_id (& cs_tlv -> splice_info -> funding_txid , funding );
11641168 }
11651169
11661170 txs = channel_txs (tmpctx , funding , funding_sats , & htlc_map ,
@@ -1236,6 +1240,7 @@ static void send_commit(struct peer *peer)
12361240 u32 feerate_target ;
12371241 u8 * * msgs = tal_arr (tmpctx , u8 * , 1 );
12381242 u8 * msg ;
1243+ u16 batch_size = tal_count (peer -> splice_state -> inflights ) + 1 ;
12391244 struct local_anchor_info * local_anchor , * anchors_info ;
12401245
12411246 if (peer -> dev_disable_commit && !* peer -> dev_disable_commit ) {
@@ -1350,7 +1355,8 @@ static void send_commit(struct peer *peer)
13501355 msgs [0 ] = send_commit_part (msgs , peer , & peer -> channel -> funding ,
13511356 peer -> channel -> funding_sats , changed_htlcs ,
13521357 true, 0 , 0 , peer -> next_index [REMOTE ],
1353- & peer -> remote_per_commit , & local_anchor );
1358+ & peer -> remote_per_commit , & local_anchor ,
1359+ batch_size );
13541360 if (local_anchor )
13551361 tal_arr_expand (& anchors_info , * local_anchor );
13561362
@@ -1378,7 +1384,8 @@ static void send_commit(struct peer *peer)
13781384 remote_splice_amnt ,
13791385 peer -> next_index [REMOTE ],
13801386 & peer -> remote_per_commit ,
1381- & local_anchor ));
1387+ & local_anchor ,
1388+ batch_size );
13821389 if (local_anchor )
13831390 tal_arr_expand (& anchors_info , * local_anchor );
13841391 }
@@ -1877,10 +1884,12 @@ static struct commitsig_info *handle_peer_commit_sig(struct peer *peer,
18771884 derive_channel_id (& active_id , & peer -> channel -> funding );
18781885 if (peer -> splice_state -> await_commitment_succcess
18791886 && !tal_count (peer -> splice_state -> inflights ) && cs_tlv && cs_tlv -> splice_info ) {
1880- if (!channel_id_eq (& active_id , cs_tlv -> splice_info )) {
1887+ if (!channel_id_eq (& active_id ,
1888+ & cs_tlv -> splice_info -> funding_txid )) {
18811889 status_info ("Ignoring stale commit_sig for channel_id"
18821890 " %s, as %s is locked in now." ,
1883- fmt_channel_id (tmpctx , cs_tlv -> splice_info ),
1891+ fmt_channel_id (tmpctx ,
1892+ & cs_tlv -> splice_info -> funding_txid ),
18841893 fmt_channel_id (tmpctx , & active_id ));
18851894 return NULL ;
18861895 }
@@ -1983,7 +1992,7 @@ static struct commitsig_info *handle_peer_commit_sig(struct peer *peer,
19831992 fmt_channel_id (tmpctx , & active_id ),
19841993 cs_tlv && cs_tlv -> splice_info
19851994 ? fmt_channel_id (tmpctx ,
1986- cs_tlv -> splice_info )
1995+ & cs_tlv -> splice_info -> funding_txid )
19871996 : "N/A" ,
19881997 peer -> splice_state -> await_commitment_succcess ? "yes"
19891998 : "no" ,
@@ -2737,7 +2746,8 @@ static struct commitsig *interactive_send_commitments(struct peer *peer,
27372746 remote_splice_amnt ,
27382747 next_index_remote - 1 ,
27392748 & peer -> old_remote_per_commit ,
2740- & local_anchor ));
2749+ & local_anchor ,
2750+ 1 );
27412751 }
27422752
27432753 result = NULL ;
@@ -2793,7 +2803,8 @@ static struct commitsig *interactive_send_commitments(struct peer *peer,
27932803 remote_splice_amnt ,
27942804 next_index_remote - 1 ,
27952805 & peer -> old_remote_per_commit ,
2796- & local_anchor ));
2806+ & local_anchor ,
2807+ 1 ));
27972808 }
27982809
27992810 /* Sending and receiving splice commit should not increment commit
@@ -4559,6 +4570,7 @@ static void resend_commitment(struct peer *peer, struct changed_htlc *last)
45594570 u8 * msg ;
45604571 u8 * * msgs = tal_arr (tmpctx , u8 * , 1 );
45614572 struct local_anchor_info * local_anchor ;
4573+ u16 batch_size = tal_count (peer -> splice_state -> inflights ) + 1 ;
45624574
45634575 status_debug ("Retransmitting commitment, feerate LOCAL=%u REMOTE=%u,"
45644576 " blockheight LOCAL=%u REMOTE=%u" ,
@@ -4653,7 +4665,7 @@ static void resend_commitment(struct peer *peer, struct changed_htlc *last)
46534665 peer -> channel -> funding_sats , NULL ,
46544666 false, 0 , 0 , peer -> next_index [REMOTE ] - 1 ,
46554667 & peer -> remote_per_commit ,
4656- & local_anchor );
4668+ & local_anchor , batch_size );
46574669
46584670 /* Loop over current inflights
46594671 * BOLT-0d8b701614b09c6ee4172b04da2203e73deec7e2 #2:
@@ -4679,7 +4691,7 @@ static void resend_commitment(struct peer *peer, struct changed_htlc *last)
46794691 remote_splice_amnt ,
46804692 peer -> next_index [REMOTE ] - 1 ,
46814693 & peer -> remote_per_commit ,
4682- & local_anchor ));
4694+ & local_anchor , batch_size ));
46834695 }
46844696
46854697 for (i = 0 ; i < tal_count (msgs ); i ++ )
0 commit comments