@@ -8807,24 +8807,42 @@ where
8807
8807
// We should never have to worry about MonitorUpdateInProgress resending ChannelReady
8808
8808
self.get_channel_ready(logger)
8809
8809
} else if splicing_negotiated {
8810
+ let funding_txid = self
8811
+ .maybe_get_my_current_funding_locked()
8812
+ .filter(|funding| !funding.is_splice())
8813
+ .map(|funding| {
8814
+ funding.get_funding_txid().expect("funding_txid should always be set")
8815
+ });
8816
+
8810
8817
// A node:
8811
8818
// - if `option_splice` was negotiated and `your_last_funding_locked` is not
8812
8819
// set in the `channel_reestablish` it received:
8813
8820
// - MUST retransmit `channel_ready`.
8814
8821
msg.your_last_funding_locked_txid
8815
8822
.is_none()
8816
- .then(|| ())
8823
+ .then(|| funding_txid)
8824
+ .flatten()
8817
8825
// The sending node:
8818
8826
// - if `my_current_funding_locked` is included:
8819
8827
// - if `announce_channel` is set for this channel:
8820
8828
// - if it has not received `announcement_signatures` for that transaction:
8821
8829
// - MUST retransmit `channel_ready` or `splice_locked` after exchanging `channel_reestablish`.
8822
8830
.or_else(|| {
8823
- self.maybe_get_my_current_funding_locked()
8824
- .filter(|funding| !funding.is_splice())
8831
+ funding_txid
8825
8832
.filter(|_| self.context.config.announce_for_forwarding)
8826
8833
.filter(|_| self.context.announcement_sigs.is_none())
8827
- .map(|_| ())
8834
+ })
8835
+ // TODO: The language from the spec below should be updated to be in terms of
8836
+ // `your_last_funding_locked` received and `my_current_funding_locked` sent rather
8837
+ // than other messages received.
8838
+ //
8839
+ // - if it receives `channel_ready` for that transaction after exchanging `channel_reestablish`:
8840
+ // - MUST retransmit `channel_ready` in response, if not already sent since reconnecting.
8841
+ .or_else(|| {
8842
+ msg.your_last_funding_locked_txid
8843
+ .and_then(|last_funding_txid| {
8844
+ funding_txid.filter(|funding_txid| last_funding_txid != *funding_txid)
8845
+ })
8828
8846
})
8829
8847
.and_then(|_| self.get_channel_ready(logger))
8830
8848
} else { None };
0 commit comments