@@ -1220,6 +1220,7 @@ pub(super) struct ReestablishResponses {
1220
1220
pub shutdown_msg: Option<msgs::Shutdown>,
1221
1221
pub tx_signatures: Option<msgs::TxSignatures>,
1222
1222
pub tx_abort: Option<msgs::TxAbort>,
1223
+ pub inferred_splice_locked: Option<msgs::SpliceLocked>,
1223
1224
}
1224
1225
1225
1226
/// The first message we send to our peer after connection
@@ -9291,6 +9292,7 @@ where
9291
9292
shutdown_msg, announcement_sigs,
9292
9293
tx_signatures,
9293
9294
tx_abort: None,
9295
+ inferred_splice_locked: None,
9294
9296
});
9295
9297
}
9296
9298
@@ -9303,6 +9305,7 @@ where
9303
9305
shutdown_msg, announcement_sigs,
9304
9306
tx_signatures,
9305
9307
tx_abort,
9308
+ inferred_splice_locked: None,
9306
9309
});
9307
9310
}
9308
9311
@@ -9338,6 +9341,30 @@ where
9338
9341
self.get_channel_ready(logger)
9339
9342
} else { None };
9340
9343
9344
+ // A receiving node:
9345
+ // - if splice transactions are pending and `my_current_funding_locked` matches one of
9346
+ // those splice transactions, for which it hasn't received `splice_locked` yet:
9347
+ // - MUST process `my_current_funding_locked` as if it was receiving `splice_locked`
9348
+ // for this `txid`.
9349
+ #[cfg(splicing)]
9350
+ let inferred_splice_locked = msg.my_current_funding_locked.as_ref().and_then(|funding_locked| {
9351
+ self.pending_funding
9352
+ .iter()
9353
+ .find(|funding| funding.get_funding_txid() == Some(funding_locked.txid))
9354
+ .and_then(|_| {
9355
+ self.pending_splice.as_ref().and_then(|pending_splice| {
9356
+ (Some(funding_locked.txid) != pending_splice.received_funding_txid)
9357
+ .then(|| funding_locked.txid)
9358
+ })
9359
+ })
9360
+ .map(|splice_txid| msgs::SpliceLocked {
9361
+ channel_id: self.context.channel_id,
9362
+ splice_txid,
9363
+ })
9364
+ });
9365
+ #[cfg(not(splicing))]
9366
+ let inferred_splice_locked = None;
9367
+
9341
9368
if msg.next_local_commitment_number == next_counterparty_commitment_number {
9342
9369
if required_revoke.is_some() || self.context.signer_pending_revoke_and_ack {
9343
9370
log_debug!(logger, "Reconnected channel {} with only lost outbound RAA", &self.context.channel_id());
@@ -9355,6 +9382,7 @@ where
9355
9382
commitment_order: self.context.resend_order.clone(),
9356
9383
tx_signatures,
9357
9384
tx_abort,
9385
+ inferred_splice_locked,
9358
9386
})
9359
9387
} else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
9360
9388
debug_assert!(commitment_update.is_none());
@@ -9379,6 +9407,7 @@ where
9379
9407
commitment_order: self.context.resend_order.clone(),
9380
9408
tx_signatures: None,
9381
9409
tx_abort,
9410
+ inferred_splice_locked,
9382
9411
})
9383
9412
} else {
9384
9413
let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -9405,6 +9434,7 @@ where
9405
9434
commitment_order: self.context.resend_order.clone(),
9406
9435
tx_signatures: None,
9407
9436
tx_abort,
9437
+ inferred_splice_locked,
9408
9438
})
9409
9439
}
9410
9440
} else if msg.next_local_commitment_number < next_counterparty_commitment_number {
0 commit comments