@@ -8404,24 +8404,42 @@ where
84048404 // We should never have to worry about MonitorUpdateInProgress resending ChannelReady
84058405 self.get_channel_ready(logger)
84068406 } else if splicing_negotiated {
8407+ let funding_txid = self
8408+ .maybe_get_my_current_funding_locked()
8409+ .filter(|funding| !funding.is_splice())
8410+ .map(|funding| {
8411+ funding.get_funding_txid().expect("funding_txid should always be set")
8412+ });
8413+
84078414 // A node:
84088415 // - if `option_splice` was negotiated and `your_last_funding_locked` is not
84098416 // set in the `channel_reestablish` it received:
84108417 // - MUST retransmit `channel_ready`.
84118418 msg.your_last_funding_locked_txid
84128419 .is_none()
8413- .then(|| ())
8420+ .then(|| funding_txid)
8421+ .flatten()
84148422 // The sending node:
84158423 // - if `my_current_funding_locked` is included:
84168424 // - if `announce_channel` is set for this channel:
84178425 // - if it has not received `announcement_signatures` for that transaction:
84188426 // - MUST retransmit `channel_ready` or `splice_locked` after exchanging `channel_reestablish`.
84198427 .or_else(|| {
8420- self.maybe_get_my_current_funding_locked()
8421- .filter(|funding| !funding.is_splice())
8428+ funding_txid
84228429 .filter(|_| self.context.config.announce_for_forwarding)
84238430 .filter(|_| self.context.announcement_sigs.is_none())
8424- .map(|_| ())
8431+ })
8432+ // TODO: The language from the spec below should be updated to be in terms of
8433+ // `your_last_funding_locked` received and `my_current_funding_locked` sent rather
8434+ // than other messages received.
8435+ //
8436+ // - if it receives `channel_ready` for that transaction after exchanging `channel_reestablish`:
8437+ // - MUST retransmit `channel_ready` in response, if not already sent since reconnecting.
8438+ .or_else(|| {
8439+ msg.your_last_funding_locked_txid
8440+ .and_then(|last_funding_txid| {
8441+ funding_txid.filter(|funding_txid| last_funding_txid != *funding_txid)
8442+ })
84258443 })
84268444 .and_then(|_| self.get_channel_ready(logger))
84278445 } else { None };
0 commit comments