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