@@ -1217,6 +1217,7 @@ pub(super) struct ReestablishResponses {
1217
1217
pub tx_signatures: Option<msgs::TxSignatures>,
1218
1218
pub tx_abort: Option<msgs::TxAbort>,
1219
1219
pub splice_locked: Option<msgs::SpliceLocked>,
1220
+ pub implicit_splice_locked: Option<msgs::SpliceLocked>,
1220
1221
}
1221
1222
1222
1223
/// The first message we send to our peer after connection
@@ -8356,6 +8357,7 @@ where
8356
8357
tx_signatures: None,
8357
8358
tx_abort: None,
8358
8359
splice_locked: None,
8360
+ implicit_splice_locked: None,
8359
8361
});
8360
8362
}
8361
8363
@@ -8368,6 +8370,7 @@ where
8368
8370
tx_signatures: None,
8369
8371
tx_abort: None,
8370
8372
splice_locked: None,
8373
+ implicit_splice_locked: None,
8371
8374
});
8372
8375
}
8373
8376
@@ -8479,6 +8482,30 @@ where
8479
8482
splice_txid,
8480
8483
});
8481
8484
8485
+ // A receiving node:
8486
+ // - if splice transactions are pending and `my_current_funding_locked` matches one of
8487
+ // those splice transactions, for which it hasn't received `splice_locked` yet:
8488
+ // - MUST process `my_current_funding_locked` as if it was receiving `splice_locked`
8489
+ // for this `txid`.
8490
+ #[cfg(splicing)]
8491
+ let implicit_splice_locked = msg.my_current_funding_locked_txid.and_then(|funding_txid| {
8492
+ self.pending_funding
8493
+ .iter()
8494
+ .find(|funding| funding.get_funding_txid() == Some(funding_txid))
8495
+ .and_then(|_| {
8496
+ self.pending_splice.as_ref().and_then(|pending_splice| {
8497
+ (Some(funding_txid) != pending_splice.received_funding_txid)
8498
+ .then(|| funding_txid)
8499
+ })
8500
+ })
8501
+ .map(|splice_txid| msgs::SpliceLocked {
8502
+ channel_id: self.context.channel_id,
8503
+ splice_txid,
8504
+ })
8505
+ });
8506
+ #[cfg(not(splicing))]
8507
+ let implicit_splice_locked = None;
8508
+
8482
8509
let mut commitment_update = None;
8483
8510
let mut tx_signatures = None;
8484
8511
let mut tx_abort = None;
@@ -8592,6 +8619,7 @@ where
8592
8619
tx_signatures,
8593
8620
tx_abort,
8594
8621
splice_locked,
8622
+ implicit_splice_locked,
8595
8623
})
8596
8624
} else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
8597
8625
// We've made an update so we must have exchanged `tx_signatures`, implying that
@@ -8614,6 +8642,7 @@ where
8614
8642
tx_signatures,
8615
8643
tx_abort,
8616
8644
splice_locked,
8645
+ implicit_splice_locked,
8617
8646
})
8618
8647
} else {
8619
8648
let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -8639,6 +8668,7 @@ where
8639
8668
tx_signatures,
8640
8669
tx_abort,
8641
8670
splice_locked,
8671
+ implicit_splice_locked,
8642
8672
})
8643
8673
}
8644
8674
} else if msg.next_local_commitment_number < next_counterparty_commitment_number {
0 commit comments