@@ -483,6 +483,7 @@ static void check_mutual_splice_locked(struct peer *peer)
483483 fmt_channel (tmpctx , peer -> channel ));
484484
485485 error = channel_update_funding (peer -> channel , & inflight -> outpoint ,
486+ inflight -> funding_tx_index ,
486487 inflight -> amnt ,
487488 inflight -> splice_amnt );
488489 if (error )
@@ -4362,6 +4363,7 @@ static void splice_accepter(struct peer *peer, const u8 *inmsg)
43624363 & peer -> splicing -> remote_funding_pubkey ,
43634364 & outpoint .txid ,
43644365 outpoint .n ,
4366+ peer -> channel -> funding_tx_index + 1 ,
43654367 funding_feerate_perkw ,
43664368 both_amount ,
43674369 peer -> splicing -> accepter_relative ,
@@ -4379,6 +4381,8 @@ static void splice_accepter(struct peer *peer, const u8 *inmsg)
43794381 & new_inflight -> outpoint .txid , NULL );
43804382 new_inflight -> remote_funding = peer -> splicing -> remote_funding_pubkey ;
43814383 new_inflight -> outpoint = outpoint ;
4384+ /* A splice's funding tx is the parent funding's index + 1. */
4385+ new_inflight -> funding_tx_index = peer -> channel -> funding_tx_index + 1 ;
43824386 new_inflight -> amnt = both_amount ;
43834387 new_inflight -> psbt = clone_psbt (new_inflight , ictx -> current_psbt );
43844388 new_inflight -> splice_amnt = peer -> splicing -> accepter_relative ;
@@ -4657,6 +4661,7 @@ static void splice_initiator_user_finalized(struct peer *peer)
46574661 & peer -> splicing -> remote_funding_pubkey ,
46584662 & current_psbt_txid ,
46594663 chan_output_index ,
4664+ peer -> channel -> funding_tx_index + 1 ,
46604665 peer -> splicing -> feerate_per_kw ,
46614666 amount_sat (new_chan_output -> amount ),
46624667 peer -> splicing -> opener_relative ,
@@ -4674,6 +4679,8 @@ static void splice_initiator_user_finalized(struct peer *peer)
46744679 NULL );
46754680 new_inflight -> remote_funding = peer -> splicing -> remote_funding_pubkey ;
46764681 new_inflight -> outpoint .n = chan_output_index ;
4682+ /* A splice's funding tx is the parent funding's index + 1. */
4683+ new_inflight -> funding_tx_index = peer -> channel -> funding_tx_index + 1 ;
46774684 new_inflight -> amnt = amount_sat (new_chan_output -> amount );
46784685 new_inflight -> splice_amnt = peer -> splicing -> opener_relative ;
46794686 new_inflight -> last_tx = NULL ;
@@ -6825,6 +6832,7 @@ static void init_channel(struct peer *peer)
68256832{
68266833 struct basepoints points [NUM_SIDES ];
68276834 struct amount_sat funding_sats ;
6835+ u32 funding_tx_index ;
68286836 struct amount_msat local_msat ;
68296837 struct pubkey funding_pubkey [NUM_SIDES ];
68306838 struct channel_config conf [NUM_SIDES ];
@@ -6854,6 +6862,7 @@ static void init_channel(struct peer *peer)
68546862 & peer -> channel_id ,
68556863 & funding ,
68566864 & funding_sats ,
6865+ & funding_tx_index ,
68576866 & minimum_depth ,
68586867 & peer -> our_blockheight ,
68596868 & blockheight_states ,
@@ -6968,6 +6977,7 @@ static void init_channel(struct peer *peer)
69686977
69696978 peer -> channel = new_full_channel (peer , & peer -> channel_id ,
69706979 & funding ,
6980+ funding_tx_index ,
69716981 minimum_depth ,
69726982 take (blockheight_states ),
69736983 lease_expiry ,
0 commit comments