@@ -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
}
@@ -7283,7 +7286,7 @@ where
7283
7286
for funding in core::iter::once(&mut self.funding).chain(
7284
7287
self.pending_splice
7285
7288
.as_mut()
7286
- .map(|pending_splice| pending_splice.pending_funding .as_mut_slice())
7289
+ .map(|pending_splice| pending_splice.negotiated_candidates .as_mut_slice())
7287
7290
.unwrap_or(&mut [])
7288
7291
.iter_mut(),
7289
7292
) {
@@ -7493,7 +7496,7 @@ where
7493
7496
for funding in core::iter::once(&mut self.funding).chain(
7494
7497
self.pending_splice
7495
7498
.as_mut()
7496
- .map(|pending_splice| pending_splice.pending_funding .as_mut_slice())
7499
+ .map(|pending_splice| pending_splice.negotiated_candidates .as_mut_slice())
7497
7500
.unwrap_or(&mut [])
7498
7501
.iter_mut(),
7499
7502
) {
@@ -9546,7 +9549,7 @@ where
9546
9549
9547
9550
let pending_splice = self.pending_splice.as_mut().unwrap();
9548
9551
9549
- debug_assert!(confirmed_funding_index < pending_splice.pending_funding .len());
9552
+ debug_assert!(confirmed_funding_index < pending_splice.negotiated_candidates .len());
9550
9553
9551
9554
let splice_txid = match pending_splice.sent_funding_txid {
9552
9555
Some(sent_funding_txid) => sent_funding_txid,
@@ -9564,7 +9567,7 @@ where
9564
9567
&self.context.channel_id,
9565
9568
);
9566
9569
9567
- let funding = &mut pending_splice.pending_funding [confirmed_funding_index];
9570
+ let funding = &mut pending_splice.negotiated_candidates [confirmed_funding_index];
9568
9571
debug_assert_eq!(Some(splice_txid), funding.get_funding_txid());
9569
9572
promote_splice_funding!(self, funding);
9570
9573
@@ -9639,7 +9642,7 @@ where
9639
9642
let mut funding_already_confirmed = false;
9640
9643
#[cfg(splicing)]
9641
9644
if let Some(pending_splice) = &mut self.pending_splice {
9642
- for (index, funding) in pending_splice.pending_funding .iter_mut().enumerate() {
9645
+ for (index, funding) in pending_splice.negotiated_candidates .iter_mut().enumerate() {
9643
9646
if self.context.check_for_funding_tx_confirmed(
9644
9647
funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
9645
9648
)? {
@@ -9674,7 +9677,7 @@ where
9674
9677
) {
9675
9678
for &(idx, tx) in txdata.iter() {
9676
9679
if idx > index_in_block {
9677
- let funding = &pending_splice.pending_funding [confirmed_funding_index];
9680
+ let funding = &pending_splice.negotiated_candidates [confirmed_funding_index];
9678
9681
self.context.check_for_funding_tx_spent(funding, tx, logger)?;
9679
9682
}
9680
9683
}
@@ -9704,7 +9707,7 @@ where
9704
9707
self.context.check_for_funding_tx_spent(&self.funding, tx, logger)?;
9705
9708
#[cfg(splicing)]
9706
9709
if let Some(pending_splice) = self.pending_splice.as_ref() {
9707
- for funding in pending_splice.pending_funding .iter() {
9710
+ for funding in pending_splice.negotiated_candidates .iter() {
9708
9711
self.context.check_for_funding_tx_spent(funding, tx, logger)?;
9709
9712
}
9710
9713
}
@@ -9833,7 +9836,7 @@ where
9833
9836
return Err(ClosureReason::ProcessingError { err });
9834
9837
},
9835
9838
};
9836
- let funding = &mut pending_splice.pending_funding [confirmed_funding_index];
9839
+ let funding = &mut pending_splice.negotiated_candidates [confirmed_funding_index];
9837
9840
9838
9841
// Check if the splice funding transaction was unconfirmed
9839
9842
if funding.get_funding_tx_confirmations(height) == 0 {
@@ -9922,7 +9925,7 @@ where
9922
9925
#[cfg(splicing)] {
9923
9926
self.pending_splice.as_mut().and_then(|pending_splice| {
9924
9927
pending_splice
9925
- .pending_funding
9928
+ .negotiated_candidates
9926
9929
.iter_mut()
9927
9930
.find(|funding| funding.get_funding_txid() == Some(*txid))
9928
9931
})
@@ -10286,7 +10289,7 @@ where
10286
10289
self.pending_splice = Some(PendingSplice {
10287
10290
our_funding_contribution: our_funding_contribution_satoshis,
10288
10291
funding: None,
10289
- pending_funding : vec![],
10292
+ negotiated_candidates : vec![],
10290
10293
sent_funding_txid: None,
10291
10294
received_funding_txid: None,
10292
10295
});
@@ -10404,7 +10407,7 @@ where
10404
10407
if let Some(sent_funding_txid) = pending_splice.sent_funding_txid {
10405
10408
if sent_funding_txid == msg.splice_txid {
10406
10409
if let Some(funding) = pending_splice
10407
- .pending_funding
10410
+ .negotiated_candidates
10408
10411
.iter_mut()
10409
10412
.find(|funding| funding.get_funding_txid() == Some(sent_funding_txid))
10410
10413
{
0 commit comments