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