@@ -8403,24 +8403,42 @@ where
8403
8403
// We should never have to worry about MonitorUpdateInProgress resending ChannelReady
8404
8404
self.get_channel_ready(logger)
8405
8405
} else if splicing_negotiated {
8406
+ let funding_txid = self
8407
+ .maybe_get_my_current_funding_locked(their_features)
8408
+ .filter(|funding| !funding.is_splice())
8409
+ .map(|funding| {
8410
+ funding.get_funding_txid().expect("funding_txid should always be set")
8411
+ });
8412
+
8406
8413
// A node:
8407
8414
// - if `option_splice` was negotiated and `your_last_funding_locked` is not
8408
8415
// set in the `channel_reestablish` it received:
8409
8416
// - MUST retransmit `channel_ready`.
8410
8417
msg.your_last_funding_locked_txid
8411
8418
.is_none()
8412
- .then(|| ())
8419
+ .then(|| funding_txid)
8420
+ .flatten()
8413
8421
// The sending node:
8414
8422
// - if `my_current_funding_locked` is included:
8415
8423
// - if `announce_channel` is set for this channel:
8416
8424
// - if it has not received `announcement_signatures` for that transaction:
8417
8425
// - MUST retransmit `channel_ready` or `splice_locked` after exchanging `channel_reestablish`.
8418
8426
.or_else(|| {
8419
- self.maybe_get_my_current_funding_locked(their_features)
8420
- .filter(|funding| !funding.is_splice())
8427
+ funding_txid
8421
8428
.filter(|_| self.context.config.announce_for_forwarding)
8422
8429
.filter(|_| self.context.announcement_sigs.is_none())
8423
- .map(|_| ())
8430
+ })
8431
+ // TODO: The language from the spec below should be updated to be in terms of
8432
+ // `your_last_funding_locked` received and `my_current_funding_locked` sent rather
8433
+ // than other messages received.
8434
+ //
8435
+ // - if it receives `channel_ready` for that transaction after exchanging `channel_reestablish`:
8436
+ // - MUST retransmit `channel_ready` in response, if not already sent since reconnecting.
8437
+ .or_else(|| {
8438
+ msg.your_last_funding_locked_txid
8439
+ .and_then(|last_funding_txid| {
8440
+ funding_txid.filter(|funding_txid| last_funding_txid != *funding_txid)
8441
+ })
8424
8442
})
8425
8443
.and_then(|_| self.get_channel_ready(logger))
8426
8444
} else { None };
0 commit comments