@@ -1214,6 +1214,7 @@ pub(super) struct ReestablishResponses {
1214
1214
pub tx_signatures: Option<msgs::TxSignatures>,
1215
1215
pub tx_abort: Option<msgs::TxAbort>,
1216
1216
pub splice_locked: Option<msgs::SpliceLocked>,
1217
+ pub implicit_splice_locked: Option<msgs::SpliceLocked>,
1217
1218
}
1218
1219
1219
1220
/// The first message we send to our peer after connection
@@ -8396,6 +8397,7 @@ where
8396
8397
tx_signatures: None,
8397
8398
tx_abort: None,
8398
8399
splice_locked: None,
8400
+ implicit_splice_locked: None,
8399
8401
});
8400
8402
}
8401
8403
@@ -8408,6 +8410,7 @@ where
8408
8410
tx_signatures: None,
8409
8411
tx_abort: None,
8410
8412
splice_locked: None,
8413
+ implicit_splice_locked: None,
8411
8414
});
8412
8415
}
8413
8416
@@ -8519,6 +8522,30 @@ where
8519
8522
splice_txid,
8520
8523
});
8521
8524
8525
+ // A receiving node:
8526
+ // - if splice transactions are pending and `my_current_funding_locked` matches one of
8527
+ // those splice transactions, for which it hasn't received `splice_locked` yet:
8528
+ // - MUST process `my_current_funding_locked` as if it was receiving `splice_locked`
8529
+ // for this `txid`.
8530
+ #[cfg(splicing)]
8531
+ let implicit_splice_locked = msg.my_current_funding_locked_txid.and_then(|funding_txid| {
8532
+ self.pending_funding
8533
+ .iter()
8534
+ .find(|funding| funding.get_funding_txid() == Some(funding_txid))
8535
+ .and_then(|_| {
8536
+ self.pending_splice.as_ref().and_then(|pending_splice| {
8537
+ (Some(funding_txid) != pending_splice.received_funding_txid)
8538
+ .then(|| funding_txid)
8539
+ })
8540
+ })
8541
+ .map(|splice_txid| msgs::SpliceLocked {
8542
+ channel_id: self.context.channel_id,
8543
+ splice_txid,
8544
+ })
8545
+ });
8546
+ #[cfg(not(splicing))]
8547
+ let implicit_splice_locked = None;
8548
+
8522
8549
let mut commitment_update = None;
8523
8550
let mut tx_signatures = None;
8524
8551
let mut tx_abort = None;
@@ -8626,6 +8653,7 @@ where
8626
8653
tx_signatures,
8627
8654
tx_abort,
8628
8655
splice_locked,
8656
+ implicit_splice_locked,
8629
8657
})
8630
8658
} else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
8631
8659
// We've made an update so we must have exchanged `tx_signatures`, implying that
@@ -8648,6 +8676,7 @@ where
8648
8676
tx_signatures,
8649
8677
tx_abort,
8650
8678
splice_locked,
8679
+ implicit_splice_locked,
8651
8680
})
8652
8681
} else {
8653
8682
let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -8673,6 +8702,7 @@ where
8673
8702
tx_signatures,
8674
8703
tx_abort,
8675
8704
splice_locked,
8705
+ implicit_splice_locked,
8676
8706
})
8677
8707
}
8678
8708
} else if msg.next_local_commitment_number < next_counterparty_commitment_number {
0 commit comments