@@ -2178,7 +2178,10 @@ impl FundingScope {
2178
2178
struct PendingSplice {
2179
2179
pub our_funding_contribution: i64,
2180
2180
funding: Option<FundingScope>,
2181
- pending_funding: Vec<FundingScope>,
2181
+
2182
+ /// Funding candidates that have been negotiated but have not reached enough confirmations
2183
+ /// by both counterparties to have exchanged `splice_locked` and be promoted.
2184
+ negotiated_candidates: Vec<FundingScope>,
2182
2185
2183
2186
/// The funding txid used in the `splice_locked` sent to the counterparty.
2184
2187
sent_funding_txid: Option<Txid>,
@@ -2195,9 +2198,9 @@ impl PendingSplice {
2195
2198
where
2196
2199
SP::Target: SignerProvider,
2197
2200
{
2198
- debug_assert!(confirmed_funding_index < self.pending_funding .len());
2201
+ debug_assert!(confirmed_funding_index < self.negotiated_candidates .len());
2199
2202
2200
- let funding = &self.pending_funding [confirmed_funding_index];
2203
+ let funding = &self.negotiated_candidates [confirmed_funding_index];
2201
2204
if !context.check_funding_meets_minimum_depth(funding, height) {
2202
2205
return None;
2203
2206
}
@@ -5999,7 +6002,7 @@ where
5999
6002
#[cfg(splicing)]
6000
6003
fn pending_funding(&self) -> &[FundingScope] {
6001
6004
if let Some(pending_splice) = &self.pending_splice {
6002
- pending_splice.pending_funding .as_slice()
6005
+ pending_splice.negotiated_candidates .as_slice()
6003
6006
} else {
6004
6007
&[]
6005
6008
}
@@ -6015,7 +6018,7 @@ where
6015
6018
core::iter::once(&mut self.funding).chain(
6016
6019
self.pending_splice
6017
6020
.as_mut()
6018
- .map(|pending_splice| pending_splice.pending_funding .as_mut_slice())
6021
+ .map(|pending_splice| pending_splice.negotiated_candidates .as_mut_slice())
6019
6022
.unwrap_or(&mut [])
6020
6023
.iter_mut(),
6021
6024
)
@@ -9545,7 +9548,7 @@ where
9545
9548
9546
9549
let pending_splice = self.pending_splice.as_mut().unwrap();
9547
9550
9548
- debug_assert!(confirmed_funding_index < pending_splice.pending_funding .len());
9551
+ debug_assert!(confirmed_funding_index < pending_splice.negotiated_candidates .len());
9549
9552
9550
9553
let splice_txid = match pending_splice.sent_funding_txid {
9551
9554
Some(sent_funding_txid) => sent_funding_txid,
@@ -9563,7 +9566,7 @@ where
9563
9566
&self.context.channel_id,
9564
9567
);
9565
9568
9566
- let funding = &mut pending_splice.pending_funding [confirmed_funding_index];
9569
+ let funding = &mut pending_splice.negotiated_candidates [confirmed_funding_index];
9567
9570
debug_assert_eq!(Some(splice_txid), funding.get_funding_txid());
9568
9571
promote_splice_funding!(self, funding);
9569
9572
@@ -9638,7 +9641,7 @@ where
9638
9641
let mut funding_already_confirmed = false;
9639
9642
#[cfg(splicing)]
9640
9643
if let Some(pending_splice) = &mut self.pending_splice {
9641
- for (index, funding) in pending_splice.pending_funding .iter_mut().enumerate() {
9644
+ for (index, funding) in pending_splice.negotiated_candidates .iter_mut().enumerate() {
9642
9645
if self.context.check_for_funding_tx_confirmed(
9643
9646
funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
9644
9647
)? {
@@ -9673,7 +9676,7 @@ where
9673
9676
) {
9674
9677
for &(idx, tx) in txdata.iter() {
9675
9678
if idx > index_in_block {
9676
- let funding = &pending_splice.pending_funding [confirmed_funding_index];
9679
+ let funding = &pending_splice.negotiated_candidates [confirmed_funding_index];
9677
9680
self.context.check_for_funding_tx_spent(funding, tx, logger)?;
9678
9681
}
9679
9682
}
@@ -9703,7 +9706,7 @@ where
9703
9706
self.context.check_for_funding_tx_spent(&self.funding, tx, logger)?;
9704
9707
#[cfg(splicing)]
9705
9708
if let Some(pending_splice) = self.pending_splice.as_ref() {
9706
- for funding in pending_splice.pending_funding .iter() {
9709
+ for funding in pending_splice.negotiated_candidates .iter() {
9707
9710
self.context.check_for_funding_tx_spent(funding, tx, logger)?;
9708
9711
}
9709
9712
}
@@ -9832,7 +9835,7 @@ where
9832
9835
return Err(ClosureReason::ProcessingError { err });
9833
9836
},
9834
9837
};
9835
- let funding = &mut pending_splice.pending_funding [confirmed_funding_index];
9838
+ let funding = &mut pending_splice.negotiated_candidates [confirmed_funding_index];
9836
9839
9837
9840
// Check if the splice funding transaction was unconfirmed
9838
9841
if funding.get_funding_tx_confirmations(height) == 0 {
@@ -10273,7 +10276,7 @@ where
10273
10276
self.pending_splice = Some(PendingSplice {
10274
10277
our_funding_contribution: our_funding_contribution_satoshis,
10275
10278
funding: None,
10276
- pending_funding : vec![],
10279
+ negotiated_candidates : vec![],
10277
10280
sent_funding_txid: None,
10278
10281
received_funding_txid: None,
10279
10282
});
@@ -10391,7 +10394,7 @@ where
10391
10394
if let Some(sent_funding_txid) = pending_splice.sent_funding_txid {
10392
10395
if sent_funding_txid == msg.splice_txid {
10393
10396
if let Some(funding) = pending_splice
10394
- .pending_funding
10397
+ .negotiated_candidates
10395
10398
.iter_mut()
10396
10399
.find(|funding| funding.get_funding_txid() == Some(sent_funding_txid))
10397
10400
{
0 commit comments