@@ -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
@@ -8750,6 +8751,7 @@ where
8750
8751
shutdown_msg, announcement_sigs,
8751
8752
tx_signatures: None,
8752
8753
tx_abort: None,
8754
+ implicit_splice_locked: None,
8753
8755
});
8754
8756
}
8755
8757
@@ -8761,6 +8763,7 @@ where
8761
8763
shutdown_msg, announcement_sigs,
8762
8764
tx_signatures: None,
8763
8765
tx_abort: None,
8766
+ implicit_splice_locked: None,
8764
8767
});
8765
8768
}
8766
8769
@@ -8796,6 +8799,30 @@ where
8796
8799
self.get_channel_ready(logger)
8797
8800
} else { None };
8798
8801
8802
+ // A receiving node:
8803
+ // - if splice transactions are pending and `my_current_funding_locked` matches one of
8804
+ // those splice transactions, for which it hasn't received `splice_locked` yet:
8805
+ // - MUST process `my_current_funding_locked` as if it was receiving `splice_locked`
8806
+ // for this `txid`.
8807
+ #[cfg(splicing)]
8808
+ let implicit_splice_locked = msg.my_current_funding_locked_txid.and_then(|funding_txid| {
8809
+ self.pending_funding
8810
+ .iter()
8811
+ .find(|funding| funding.get_funding_txid() == Some(funding_txid))
8812
+ .and_then(|_| {
8813
+ self.pending_splice.as_ref().and_then(|pending_splice| {
8814
+ (Some(funding_txid) != pending_splice.received_funding_txid)
8815
+ .then(|| funding_txid)
8816
+ })
8817
+ })
8818
+ .map(|splice_txid| msgs::SpliceLocked {
8819
+ channel_id: self.context.channel_id,
8820
+ splice_txid,
8821
+ })
8822
+ });
8823
+ #[cfg(not(splicing))]
8824
+ let implicit_splice_locked = None;
8825
+
8799
8826
let mut commitment_update = None;
8800
8827
let mut tx_signatures = None;
8801
8828
let mut tx_abort = None;
@@ -8904,6 +8931,7 @@ where
8904
8931
order: self.context.resend_order.clone(),
8905
8932
tx_signatures,
8906
8933
tx_abort,
8934
+ implicit_splice_locked,
8907
8935
})
8908
8936
} else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
8909
8937
// We've made an update so we must have exchanged `tx_signatures`, implying that
@@ -8925,6 +8953,7 @@ where
8925
8953
order: self.context.resend_order.clone(),
8926
8954
tx_signatures,
8927
8955
tx_abort,
8956
+ implicit_splice_locked,
8928
8957
})
8929
8958
} else {
8930
8959
let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -8949,6 +8978,7 @@ where
8949
8978
order: self.context.resend_order.clone(),
8950
8979
tx_signatures,
8951
8980
tx_abort,
8981
+ implicit_splice_locked,
8952
8982
})
8953
8983
}
8954
8984
} else if msg.next_local_commitment_number < next_counterparty_commitment_number {
0 commit comments