@@ -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 inferred_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
+ inferred_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
+ inferred_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 inferred_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 inferred_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;
@@ -8874,6 +8901,7 @@ where
8874
8901
order: self.context.resend_order.clone(),
8875
8902
tx_signatures,
8876
8903
tx_abort,
8904
+ inferred_splice_locked,
8877
8905
})
8878
8906
} else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
8879
8907
// We've made an update so we must have exchanged `tx_signatures`, implying that
@@ -8895,6 +8923,7 @@ where
8895
8923
order: self.context.resend_order.clone(),
8896
8924
tx_signatures,
8897
8925
tx_abort,
8926
+ inferred_splice_locked,
8898
8927
})
8899
8928
} else {
8900
8929
let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -8919,6 +8948,7 @@ where
8919
8948
order: self.context.resend_order.clone(),
8920
8949
tx_signatures,
8921
8950
tx_abort,
8951
+ inferred_splice_locked,
8922
8952
})
8923
8953
}
8924
8954
} else if msg.next_local_commitment_number < next_counterparty_commitment_number {
0 commit comments