@@ -8404,24 +8404,42 @@ where
8404
8404
// We should never have to worry about MonitorUpdateInProgress resending ChannelReady
8405
8405
self.get_channel_ready(logger)
8406
8406
} 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
+
8407
8414
// A node:
8408
8415
// - if `option_splice` was negotiated and `your_last_funding_locked` is not
8409
8416
// set in the `channel_reestablish` it received:
8410
8417
// - MUST retransmit `channel_ready`.
8411
8418
msg.your_last_funding_locked_txid
8412
8419
.is_none()
8413
- .then(|| ())
8420
+ .then(|| funding_txid)
8421
+ .flatten()
8414
8422
// The sending node:
8415
8423
// - if `my_current_funding_locked` is included:
8416
8424
// - if `announce_channel` is set for this channel:
8417
8425
// - if it has not received `announcement_signatures` for that transaction:
8418
8426
// - MUST retransmit `channel_ready` or `splice_locked` after exchanging `channel_reestablish`.
8419
8427
.or_else(|| {
8420
- self.maybe_get_my_current_funding_locked()
8421
- .filter(|funding| !funding.is_splice())
8428
+ funding_txid
8422
8429
.filter(|_| self.context.config.announce_for_forwarding)
8423
8430
.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
+ })
8425
8443
})
8426
8444
.and_then(|_| self.get_channel_ready(logger))
8427
8445
} else { None };
0 commit comments