@@ -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 .get(confirmed_funding_index).unwrap();
2203
+ let funding = self.negotiated_candidates .get(confirmed_funding_index).unwrap();
2201
2204
if !context.check_funding_meets_minimum_depth(funding, height) {
2202
2205
return None;
2203
2206
}
@@ -5998,7 +6001,7 @@ where
5998
6001
{
5999
6002
fn pending_funding(&self) -> &[FundingScope] {
6000
6003
if let Some(pending_splice) = &self.pending_splice {
6001
- pending_splice.pending_funding .as_slice()
6004
+ pending_splice.negotiated_candidates .as_slice()
6002
6005
} else {
6003
6006
&[]
6004
6007
}
@@ -7277,7 +7280,7 @@ where
7277
7280
*self.funding.next_local_commitment_tx_fee_info_cached.lock().unwrap() = None;
7278
7281
*self.funding.next_remote_commitment_tx_fee_info_cached.lock().unwrap() = None;
7279
7282
if let Some(pending_splice) = self.pending_splice.as_mut() {
7280
- for funding in pending_splice.pending_funding .iter_mut() {
7283
+ for funding in pending_splice.negotiated_candidates .iter_mut() {
7281
7284
*funding.next_local_commitment_tx_fee_info_cached.lock().unwrap() = None;
7282
7285
*funding.next_remote_commitment_tx_fee_info_cached.lock().unwrap() = None;
7283
7286
}
@@ -7484,7 +7487,7 @@ where
7484
7487
self.funding.value_to_self_msat =
7485
7488
(self.funding.value_to_self_msat as i64 + value_to_self_msat_diff) as u64;
7486
7489
if let Some(pending_splice) = self.pending_splice.as_mut() {
7487
- for funding in pending_splice.pending_funding .iter_mut() {
7490
+ for funding in pending_splice.negotiated_candidates .iter_mut() {
7488
7491
funding.value_to_self_msat =
7489
7492
(funding.value_to_self_msat as i64 + value_to_self_msat_diff) as u64;
7490
7493
}
@@ -9531,7 +9534,7 @@ where
9531
9534
9532
9535
let pending_splice = self.pending_splice.as_mut().unwrap();
9533
9536
9534
- debug_assert!(confirmed_funding_index < pending_splice.pending_funding .len());
9537
+ debug_assert!(confirmed_funding_index < pending_splice.negotiated_candidates .len());
9535
9538
9536
9539
let splice_txid = match pending_splice.sent_funding_txid {
9537
9540
Some(sent_funding_txid) => sent_funding_txid,
@@ -9549,7 +9552,8 @@ where
9549
9552
&self.context.channel_id,
9550
9553
);
9551
9554
9552
- let funding = pending_splice.pending_funding.get_mut(confirmed_funding_index).unwrap();
9555
+ let funding =
9556
+ pending_splice.negotiated_candidates.get_mut(confirmed_funding_index).unwrap();
9553
9557
debug_assert_eq!(Some(splice_txid), funding.get_funding_txid());
9554
9558
promote_splice_funding!(self, funding);
9555
9559
@@ -9624,7 +9628,7 @@ where
9624
9628
let mut funding_already_confirmed = false;
9625
9629
#[cfg(splicing)]
9626
9630
if let Some(pending_splice) = &mut self.pending_splice {
9627
- for (index, funding) in pending_splice.pending_funding .iter_mut().enumerate() {
9631
+ for (index, funding) in pending_splice.negotiated_candidates .iter_mut().enumerate() {
9628
9632
if self.context.check_for_funding_tx_confirmed(
9629
9633
funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
9630
9634
)? {
@@ -9659,7 +9663,7 @@ where
9659
9663
) {
9660
9664
for &(idx, tx) in txdata.iter() {
9661
9665
if idx > index_in_block {
9662
- let funding = pending_splice.pending_funding .get(confirmed_funding_index).unwrap();
9666
+ let funding = pending_splice.negotiated_candidates .get(confirmed_funding_index).unwrap();
9663
9667
self.context.check_for_funding_tx_spent(funding, tx, logger)?;
9664
9668
}
9665
9669
}
@@ -9689,7 +9693,7 @@ where
9689
9693
self.context.check_for_funding_tx_spent(&self.funding, tx, logger)?;
9690
9694
#[cfg(splicing)]
9691
9695
if let Some(pending_splice) = self.pending_splice.as_ref() {
9692
- for funding in pending_splice.pending_funding .iter() {
9696
+ for funding in pending_splice.negotiated_candidates .iter() {
9693
9697
self.context.check_for_funding_tx_spent(funding, tx, logger)?;
9694
9698
}
9695
9699
}
@@ -9818,7 +9822,7 @@ where
9818
9822
return Err(ClosureReason::ProcessingError { err });
9819
9823
},
9820
9824
};
9821
- let funding = pending_splice.pending_funding .get_mut(confirmed_funding_index).unwrap();
9825
+ let funding = pending_splice.negotiated_candidates .get_mut(confirmed_funding_index).unwrap();
9822
9826
9823
9827
// Check if the splice funding transaction was unconfirmed
9824
9828
if funding.get_funding_tx_confirmations(height) == 0 {
@@ -9906,7 +9910,7 @@ where
9906
9910
.or_else(|| {
9907
9911
self.pending_splice.as_mut().and_then(|pending_splice| {
9908
9912
pending_splice
9909
- .pending_funding
9913
+ .negotiated_candidates
9910
9914
.iter_mut()
9911
9915
.find(|funding| funding.get_funding_txid() == Some(*txid))
9912
9916
})
@@ -10266,7 +10270,7 @@ where
10266
10270
self.pending_splice = Some(PendingSplice {
10267
10271
our_funding_contribution: our_funding_contribution_satoshis,
10268
10272
funding: None,
10269
- pending_funding : vec![],
10273
+ negotiated_candidates : vec![],
10270
10274
sent_funding_txid: None,
10271
10275
received_funding_txid: None,
10272
10276
});
@@ -10384,7 +10388,7 @@ where
10384
10388
if let Some(sent_funding_txid) = pending_splice.sent_funding_txid {
10385
10389
if sent_funding_txid == msg.splice_txid {
10386
10390
if let Some(funding) = pending_splice
10387
- .pending_funding
10391
+ .negotiated_candidates
10388
10392
.iter_mut()
10389
10393
.find(|funding| funding.get_funding_txid() == Some(sent_funding_txid))
10390
10394
{
0 commit comments