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