@@ -8443,24 +8443,42 @@ where
8443
8443
// We should never have to worry about MonitorUpdateInProgress resending ChannelReady
8444
8444
self.get_channel_ready(logger)
8445
8445
} else if splicing_negotiated {
8446
+ let funding_txid = self
8447
+ .maybe_get_my_current_funding_locked(features)
8448
+ .filter(|funding| !funding.is_splice())
8449
+ .map(|funding| {
8450
+ funding.get_funding_txid().expect("funding_txid should always be set")
8451
+ });
8452
+
8446
8453
// A node:
8447
8454
// - if `option_splice` was negotiated and `your_last_funding_locked` is not
8448
8455
// set in the `channel_reestablish` it received:
8449
8456
// - MUST retransmit `channel_ready`.
8450
8457
msg.your_last_funding_locked_txid
8451
8458
.is_none()
8452
- .then(|| ())
8459
+ .then(|| funding_txid)
8460
+ .flatten()
8453
8461
// The sending node:
8454
8462
// - if `my_current_funding_locked` is included:
8455
8463
// - if `announce_channel` is set for this channel:
8456
8464
// - if it has not received `announcement_signatures` for that transaction:
8457
8465
// - MUST retransmit `channel_ready` or `splice_locked` after exchanging `channel_reestablish`.
8458
8466
.or_else(|| {
8459
- self.maybe_get_my_current_funding_locked(features)
8460
- .filter(|funding| !funding.is_splice())
8467
+ funding_txid
8461
8468
.filter(|_| self.context.config.announce_for_forwarding)
8462
8469
.filter(|_| self.context.announcement_sigs.is_none())
8463
- .map(|_| ())
8470
+ })
8471
+ // TODO: The language from the spec below should be updated to be in terms of
8472
+ // `your_last_funding_locked` received and `my_current_funding_locked` sent rather
8473
+ // than other messages received.
8474
+ //
8475
+ // - if it receives `channel_ready` for that transaction after exchanging `channel_reestablish`:
8476
+ // - MUST retransmit `channel_ready` in response, if not already sent since reconnecting.
8477
+ .or_else(|| {
8478
+ msg.your_last_funding_locked_txid
8479
+ .and_then(|last_funding_txid| {
8480
+ funding_txid.filter(|funding_txid| last_funding_txid != *funding_txid)
8481
+ })
8464
8482
})
8465
8483
.and_then(|_| self.get_channel_ready(logger))
8466
8484
} else { None };
0 commit comments