@@ -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
@@ -8368,6 +8369,7 @@ where
8368
8369
tx_signatures: None,
8369
8370
tx_abort: None,
8370
8371
splice_locked: None,
8372
+ implicit_splice_locked: None,
8371
8373
});
8372
8374
}
8373
8375
@@ -8380,6 +8382,7 @@ where
8380
8382
tx_signatures: None,
8381
8383
tx_abort: None,
8382
8384
splice_locked: None,
8385
+ implicit_splice_locked: None,
8383
8386
});
8384
8387
}
8385
8388
@@ -8491,6 +8494,30 @@ where
8491
8494
splice_txid,
8492
8495
});
8493
8496
8497
+ // A receiving node:
8498
+ // - if splice transactions are pending and `my_current_funding_locked` matches one of
8499
+ // those splice transactions, for which it hasn't received `splice_locked` yet:
8500
+ // - MUST process `my_current_funding_locked` as if it was receiving `splice_locked`
8501
+ // for this `txid`.
8502
+ #[cfg(splicing)]
8503
+ let implicit_splice_locked = msg.my_current_funding_locked_txid.and_then(|funding_txid| {
8504
+ self.pending_funding
8505
+ .iter()
8506
+ .find(|funding| funding.get_funding_txid() == Some(funding_txid))
8507
+ .and_then(|_| {
8508
+ self.pending_splice.as_ref().and_then(|pending_splice| {
8509
+ (Some(funding_txid) != pending_splice.received_funding_txid)
8510
+ .then(|| funding_txid)
8511
+ })
8512
+ })
8513
+ .map(|splice_txid| msgs::SpliceLocked {
8514
+ channel_id: self.context.channel_id,
8515
+ splice_txid,
8516
+ })
8517
+ });
8518
+ #[cfg(not(splicing))]
8519
+ let implicit_splice_locked = None;
8520
+
8494
8521
let mut commitment_update = None;
8495
8522
let mut tx_signatures = None;
8496
8523
let mut tx_abort = None;
@@ -8598,6 +8625,7 @@ where
8598
8625
tx_signatures,
8599
8626
tx_abort,
8600
8627
splice_locked,
8628
+ implicit_splice_locked,
8601
8629
})
8602
8630
} else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
8603
8631
// We've made an update so we must have exchanged `tx_signatures`, implying that
@@ -8620,6 +8648,7 @@ where
8620
8648
tx_signatures,
8621
8649
tx_abort,
8622
8650
splice_locked,
8651
+ implicit_splice_locked,
8623
8652
})
8624
8653
} else {
8625
8654
let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -8645,6 +8674,7 @@ where
8645
8674
tx_signatures,
8646
8675
tx_abort,
8647
8676
splice_locked,
8677
+ implicit_splice_locked,
8648
8678
})
8649
8679
}
8650
8680
} else if msg.next_local_commitment_number < next_counterparty_commitment_number {
0 commit comments