@@ -1220,6 +1220,7 @@ pub(super) struct ReestablishResponses {
12201220 pub shutdown_msg: Option<msgs::Shutdown>,
12211221 pub tx_signatures: Option<msgs::TxSignatures>,
12221222 pub tx_abort: Option<msgs::TxAbort>,
1223+ pub inferred_splice_locked: Option<msgs::SpliceLocked>,
12231224}
12241225
12251226/// The first message we send to our peer after connection
@@ -9291,6 +9292,7 @@ where
92919292 shutdown_msg, announcement_sigs,
92929293 tx_signatures,
92939294 tx_abort: None,
9295+ inferred_splice_locked: None,
92949296 });
92959297 }
92969298
@@ -9303,6 +9305,7 @@ where
93039305 shutdown_msg, announcement_sigs,
93049306 tx_signatures,
93059307 tx_abort,
9308+ inferred_splice_locked: None,
93069309 });
93079310 }
93089311
@@ -9338,6 +9341,30 @@ where
93389341 self.get_channel_ready(logger)
93399342 } else { None };
93409343
9344+ // A receiving node:
9345+ // - if splice transactions are pending and `my_current_funding_locked` matches one of
9346+ // those splice transactions, for which it hasn't received `splice_locked` yet:
9347+ // - MUST process `my_current_funding_locked` as if it was receiving `splice_locked`
9348+ // for this `txid`.
9349+ #[cfg(splicing)]
9350+ let inferred_splice_locked = msg.my_current_funding_locked.as_ref().and_then(|funding_locked| {
9351+ self.pending_funding
9352+ .iter()
9353+ .find(|funding| funding.get_funding_txid() == Some(funding_locked.txid))
9354+ .and_then(|_| {
9355+ self.pending_splice.as_ref().and_then(|pending_splice| {
9356+ (Some(funding_locked.txid) != pending_splice.received_funding_txid)
9357+ .then(|| funding_locked.txid)
9358+ })
9359+ })
9360+ .map(|splice_txid| msgs::SpliceLocked {
9361+ channel_id: self.context.channel_id,
9362+ splice_txid,
9363+ })
9364+ });
9365+ #[cfg(not(splicing))]
9366+ let inferred_splice_locked = None;
9367+
93419368 if msg.next_local_commitment_number == next_counterparty_commitment_number {
93429369 if required_revoke.is_some() || self.context.signer_pending_revoke_and_ack {
93439370 log_debug!(logger, "Reconnected channel {} with only lost outbound RAA", &self.context.channel_id());
@@ -9355,6 +9382,7 @@ where
93559382 commitment_order: self.context.resend_order.clone(),
93569383 tx_signatures,
93579384 tx_abort,
9385+ inferred_splice_locked,
93589386 })
93599387 } else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
93609388 debug_assert!(commitment_update.is_none());
@@ -9379,6 +9407,7 @@ where
93799407 commitment_order: self.context.resend_order.clone(),
93809408 tx_signatures: None,
93819409 tx_abort,
9410+ inferred_splice_locked,
93829411 })
93839412 } else {
93849413 let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -9405,6 +9434,7 @@ where
94059434 commitment_order: self.context.resend_order.clone(),
94069435 tx_signatures: None,
94079436 tx_abort,
9437+ inferred_splice_locked,
94089438 })
94099439 }
94109440 } else if msg.next_local_commitment_number < next_counterparty_commitment_number {
0 commit comments