@@ -3361,7 +3361,8 @@ static void resume_splice_negotiation(struct peer *peer,
33613361
33623362 msg = towire_channeld_update_inflight (NULL , current_psbt ,
33633363 their_commit -> tx ,
3364- & their_commit -> commit_signature );
3364+ & their_commit -> commit_signature ,
3365+ inflight -> is_locked );
33653366 wire_sync_write (MASTER_FD , take (msg ));
33663367 }
33673368
@@ -3431,7 +3432,8 @@ static void resume_splice_negotiation(struct peer *peer,
34313432 inflight -> force_sign_first )
34323433 && send_signature ) {
34333434 msg = towire_channeld_update_inflight (NULL , current_psbt ,
3434- NULL , NULL );
3435+ NULL , NULL ,
3436+ inflight -> is_locked );
34353437 wire_sync_write (MASTER_FD , take (msg ));
34363438
34373439 msg = towire_channeld_splice_sending_sigs (tmpctx , & final_txid );
@@ -3600,7 +3602,8 @@ static void resume_splice_negotiation(struct peer *peer,
36003602 if (recv_signature ) {
36013603 /* We let core validate our peer's signatures are correct. */
36023604 msg = towire_channeld_update_inflight (NULL , current_psbt , NULL ,
3603- NULL );
3605+ NULL ,
3606+ inflight -> is_locked );
36043607 wire_sync_write (MASTER_FD , take (msg ));
36053608 }
36063609
@@ -3831,6 +3834,7 @@ static void splice_accepter(struct peer *peer, const u8 *inmsg)
38313834 new_inflight -> last_tx = NULL ;
38323835 new_inflight -> i_am_initiator = false;
38333836 new_inflight -> force_sign_first = peer -> splicing -> force_sign_first ;
3837+ new_inflight -> is_locked = false;
38343838
38353839 current_push_val = relative_splice_balance_fundee (peer , our_role ,ictx -> current_psbt ,
38363840 outpoint .n , splice_funding_index );
@@ -4055,6 +4059,7 @@ static void splice_initiator_user_finalized(struct peer *peer)
40554059 new_inflight -> last_tx = NULL ;
40564060 new_inflight -> i_am_initiator = true;
40574061 new_inflight -> force_sign_first = peer -> splicing -> force_sign_first ;
4062+ new_inflight -> is_locked = false;
40584063
40594064 /* Switch over to using inflight psbt. This allows us to be reentrant.
40604065 * On restart we *will* have inflight psbt but we will not have any
@@ -4085,7 +4090,8 @@ static void splice_initiator_user_finalized(struct peer *peer)
40854090
40864091 outmsg = towire_channeld_update_inflight (NULL , new_inflight -> psbt ,
40874092 their_commit -> tx ,
4088- & their_commit -> commit_signature );
4093+ & their_commit -> commit_signature ,
4094+ new_inflight -> is_locked );
40894095 wire_sync_write (MASTER_FD , take (outmsg ));
40904096
40914097 sign_first = do_i_sign_first (peer , new_inflight -> psbt , our_role ,
@@ -4244,7 +4250,8 @@ static void splice_initiator_user_signed(struct peer *peer, const u8 *inmsg)
42444250 * restart and reestablish later. */
42454251 outmsg = towire_channeld_update_inflight (NULL , inflight -> psbt ,
42464252 inflight -> last_tx ,
4247- & inflight -> last_sig );
4253+ & inflight -> last_sig ,
4254+ inflight -> is_locked );
42484255
42494256 wire_sync_write (MASTER_FD , take (outmsg ));
42504257
@@ -5597,6 +5604,20 @@ static void handle_funding_depth(struct peer *peer, const u8 *msg)
55975604
55985605 peer -> splice_state -> locked_txid = txid ;
55995606
5607+ for (size_t i = 0 ; i < tal_count (peer -> splice_state -> inflights ); i ++ ) {
5608+ struct inflight * inflight = peer -> splice_state -> inflights [i ];
5609+ if (bitcoin_txid_eq (& inflight -> outpoint .txid ,
5610+ & txid )) {
5611+ inflight -> is_locked = true;
5612+ msg = towire_channeld_update_inflight (NULL ,
5613+ inflight -> psbt ,
5614+ NULL ,
5615+ NULL ,
5616+ inflight -> is_locked );
5617+ wire_sync_write (MASTER_FD , take (msg ));
5618+ }
5619+ }
5620+
56005621 peer_write (peer -> pps , take (msg ));
56015622
56025623 peer -> splice_state -> locked_ready [LOCAL ] = true;
@@ -6068,6 +6089,7 @@ static void init_channel(struct peer *peer)
60686089 struct penalty_base * pbases ;
60696090 bool reestablish_only ;
60706091 struct channel_type * channel_type ;
6092+ bool found_locked_inflight ;
60716093
60726094 assert (!(fcntl (MASTER_FD , F_GETFL ) & O_NONBLOCK ));
60736095
0 commit comments