@@ -1216,6 +1216,7 @@ pub(super) struct ReestablishResponses {
1216
1216
pub tx_signatures: Option<msgs::TxSignatures>,
1217
1217
pub tx_abort: Option<msgs::TxAbort>,
1218
1218
pub splice_locked: Option<msgs::SpliceLocked>,
1219
+ pub implicit_splice_locked: Option<msgs::SpliceLocked>,
1219
1220
}
1220
1221
1221
1222
/// The first message we send to our peer after connection
@@ -8758,6 +8759,7 @@ where
8758
8759
tx_signatures: None,
8759
8760
tx_abort: None,
8760
8761
splice_locked: None,
8762
+ implicit_splice_locked: None,
8761
8763
});
8762
8764
}
8763
8765
@@ -8770,6 +8772,7 @@ where
8770
8772
tx_signatures: None,
8771
8773
tx_abort: None,
8772
8774
splice_locked: None,
8775
+ implicit_splice_locked: None,
8773
8776
});
8774
8777
}
8775
8778
@@ -8883,6 +8886,30 @@ where
8883
8886
splice_txid,
8884
8887
});
8885
8888
8889
+ // A receiving node:
8890
+ // - if splice transactions are pending and `my_current_funding_locked` matches one of
8891
+ // those splice transactions, for which it hasn't received `splice_locked` yet:
8892
+ // - MUST process `my_current_funding_locked` as if it was receiving `splice_locked`
8893
+ // for this `txid`.
8894
+ #[cfg(splicing)]
8895
+ let implicit_splice_locked = msg.my_current_funding_locked_txid.and_then(|funding_txid| {
8896
+ self.pending_funding
8897
+ .iter()
8898
+ .find(|funding| funding.get_funding_txid() == Some(funding_txid))
8899
+ .and_then(|_| {
8900
+ self.pending_splice.as_ref().and_then(|pending_splice| {
8901
+ (Some(funding_txid) != pending_splice.received_funding_txid)
8902
+ .then(|| funding_txid)
8903
+ })
8904
+ })
8905
+ .map(|splice_txid| msgs::SpliceLocked {
8906
+ channel_id: self.context.channel_id,
8907
+ splice_txid,
8908
+ })
8909
+ });
8910
+ #[cfg(not(splicing))]
8911
+ let implicit_splice_locked = None;
8912
+
8886
8913
let mut commitment_update = None;
8887
8914
let mut tx_signatures = None;
8888
8915
let mut tx_abort = None;
@@ -8992,6 +9019,7 @@ where
8992
9019
tx_signatures,
8993
9020
tx_abort,
8994
9021
splice_locked,
9022
+ implicit_splice_locked,
8995
9023
})
8996
9024
} else if msg.next_local_commitment_number == next_counterparty_commitment_number - 1 {
8997
9025
// We've made an update so we must have exchanged `tx_signatures`, implying that
@@ -9014,6 +9042,7 @@ where
9014
9042
tx_signatures,
9015
9043
tx_abort,
9016
9044
splice_locked,
9045
+ implicit_splice_locked,
9017
9046
})
9018
9047
} else {
9019
9048
let commitment_update = if self.context.resend_order == RAACommitmentOrder::RevokeAndACKFirst
@@ -9039,6 +9068,7 @@ where
9039
9068
tx_signatures,
9040
9069
tx_abort,
9041
9070
splice_locked,
9071
+ implicit_splice_locked,
9042
9072
})
9043
9073
}
9044
9074
} else if msg.next_local_commitment_number < next_counterparty_commitment_number {
0 commit comments