@@ -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
@@ -9328,6 +9329,7 @@ where
9328
9329
shutdown_msg, announcement_sigs,
9329
9330
tx_signatures,
9330
9331
tx_abort: None,
9332
+ inferred_splice_locked: None,
9331
9333
});
9332
9334
}
9333
9335
@@ -9340,6 +9342,7 @@ where
9340
9342
shutdown_msg, announcement_sigs,
9341
9343
tx_signatures,
9342
9344
tx_abort,
9345
+ inferred_splice_locked: None,
9343
9346
});
9344
9347
}
9345
9348
@@ -9375,6 +9378,30 @@ where
9375
9378
self.get_channel_ready(logger)
9376
9379
} else { None };
9377
9380
9381
+ // A receiving node:
9382
+ // - if splice transactions are pending and `my_current_funding_locked` matches one of
9383
+ // those splice transactions, for which it hasn't received `splice_locked` yet:
9384
+ // - MUST process `my_current_funding_locked` as if it was receiving `splice_locked`
9385
+ // for this `txid`.
9386
+ #[cfg(splicing)]
9387
+ let inferred_splice_locked = msg.my_current_funding_locked.as_ref().and_then(|funding_locked| {
9388
+ self.pending_funding
9389
+ .iter()
9390
+ .find(|funding| funding.get_funding_txid() == Some(funding_locked.txid))
9391
+ .and_then(|_| {
9392
+ self.pending_splice.as_ref().and_then(|pending_splice| {
9393
+ (Some(funding_locked.txid) != pending_splice.received_funding_txid)
9394
+ .then(|| funding_locked.txid)
9395
+ })
9396
+ })
9397
+ .map(|splice_txid| msgs::SpliceLocked {
9398
+ channel_id: self.context.channel_id,
9399
+ splice_txid,
9400
+ })
9401
+ });
9402
+ #[cfg(not(splicing))]
9403
+ let inferred_splice_locked = None;
9404
+
9378
9405
if msg.next_local_commitment_number == next_counterparty_commitment_number {
9379
9406
if required_revoke.is_some() || self.context.signer_pending_revoke_and_ack {
9380
9407
log_debug!(logger, "Reconnected channel {} with only lost outbound RAA", &self.context.channel_id());
@@ -9392,6 +9419,7 @@ where
9392
9419
commitment_order: self.context.resend_order.clone(),
9393
9420
tx_signatures,
9394
9421
tx_abort,
9422
+ inferred_splice_locked,
9395
9423
})
9396
9424
} else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
9397
9425
debug_assert!(commitment_update.is_none());
@@ -9416,6 +9444,7 @@ where
9416
9444
commitment_order: self.context.resend_order.clone(),
9417
9445
tx_signatures: None,
9418
9446
tx_abort,
9447
+ inferred_splice_locked,
9419
9448
})
9420
9449
} else {
9421
9450
let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -9442,6 +9471,7 @@ where
9442
9471
commitment_order: self.context.resend_order.clone(),
9443
9472
tx_signatures: None,
9444
9473
tx_abort,
9474
+ inferred_splice_locked,
9445
9475
})
9446
9476
}
9447
9477
} else if msg.next_local_commitment_number < next_counterparty_commitment_number {
0 commit comments