@@ -1215,6 +1215,7 @@ pub(super) struct ReestablishResponses {
1215
1215
pub shutdown_msg: Option<msgs::Shutdown>,
1216
1216
pub tx_signatures: Option<msgs::TxSignatures>,
1217
1217
pub tx_abort: Option<msgs::TxAbort>,
1218
+ pub implicit_splice_locked: Option<msgs::SpliceLocked>,
1218
1219
}
1219
1220
1220
1221
/// The first message we send to our peer after connection
@@ -8734,6 +8735,7 @@ where
8734
8735
shutdown_msg, announcement_sigs,
8735
8736
tx_signatures: None,
8736
8737
tx_abort: None,
8738
+ implicit_splice_locked: None,
8737
8739
});
8738
8740
}
8739
8741
@@ -8745,6 +8747,7 @@ where
8745
8747
shutdown_msg, announcement_sigs,
8746
8748
tx_signatures: None,
8747
8749
tx_abort: None,
8750
+ implicit_splice_locked: None,
8748
8751
});
8749
8752
}
8750
8753
@@ -8780,6 +8783,30 @@ where
8780
8783
self.get_channel_ready(logger)
8781
8784
} else { None };
8782
8785
8786
+ // A receiving node:
8787
+ // - if splice transactions are pending and `my_current_funding_locked` matches one of
8788
+ // those splice transactions, for which it hasn't received `splice_locked` yet:
8789
+ // - MUST process `my_current_funding_locked` as if it was receiving `splice_locked`
8790
+ // for this `txid`.
8791
+ #[cfg(splicing)]
8792
+ let implicit_splice_locked = msg.my_current_funding_locked.as_ref().and_then(|funding_locked| {
8793
+ self.pending_funding
8794
+ .iter()
8795
+ .find(|funding| funding.get_funding_txid() == Some(funding_locked.txid))
8796
+ .and_then(|_| {
8797
+ self.pending_splice.as_ref().and_then(|pending_splice| {
8798
+ (Some(funding_locked.txid) != pending_splice.received_funding_txid)
8799
+ .then(|| funding_locked.txid)
8800
+ })
8801
+ })
8802
+ .map(|splice_txid| msgs::SpliceLocked {
8803
+ channel_id: self.context.channel_id,
8804
+ splice_txid,
8805
+ })
8806
+ });
8807
+ #[cfg(not(splicing))]
8808
+ let implicit_splice_locked = None;
8809
+
8783
8810
let mut commitment_update = None;
8784
8811
let mut tx_signatures = None;
8785
8812
let mut tx_abort = None;
@@ -8888,6 +8915,7 @@ where
8888
8915
order: self.context.resend_order.clone(),
8889
8916
tx_signatures,
8890
8917
tx_abort,
8918
+ implicit_splice_locked,
8891
8919
})
8892
8920
} else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
8893
8921
// We've made an update so we must have exchanged `tx_signatures`, implying that
@@ -8909,6 +8937,7 @@ where
8909
8937
order: self.context.resend_order.clone(),
8910
8938
tx_signatures,
8911
8939
tx_abort,
8940
+ implicit_splice_locked,
8912
8941
})
8913
8942
} else {
8914
8943
let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -8933,6 +8962,7 @@ where
8933
8962
order: self.context.resend_order.clone(),
8934
8963
tx_signatures,
8935
8964
tx_abort,
8965
+ implicit_splice_locked,
8936
8966
})
8937
8967
}
8938
8968
} else if msg.next_local_commitment_number < next_counterparty_commitment_number {
0 commit comments