@@ -2175,7 +2175,10 @@ impl FundingScope {
2175
2175
struct PendingSplice {
2176
2176
pub our_funding_contribution: i64,
2177
2177
funding: Option<FundingScope>,
2178
- pending_funding: Vec<FundingScope>,
2178
+
2179
+ /// Funding candidates that have been negotiated but have not reached enough confirmations
2180
+ /// by both counterparties to have exchanged `splice_locked` and be promoted.
2181
+ negotiated_candidates: Vec<FundingScope>,
2179
2182
2180
2183
/// The funding txid used in the `splice_locked` sent to the counterparty.
2181
2184
sent_funding_txid: Option<Txid>,
@@ -2192,9 +2195,9 @@ impl PendingSplice {
2192
2195
where
2193
2196
SP::Target: SignerProvider,
2194
2197
{
2195
- debug_assert!(confirmed_funding_index < self.pending_funding .len());
2198
+ debug_assert!(confirmed_funding_index < self.negotiated_candidates .len());
2196
2199
2197
- let funding = self.pending_funding .get(confirmed_funding_index).unwrap();
2200
+ let funding = self.negotiated_candidates .get(confirmed_funding_index).unwrap();
2198
2201
if !context.check_funding_meets_minimum_depth(funding, height) {
2199
2202
return None;
2200
2203
}
@@ -6052,7 +6055,7 @@ where
6052
6055
{
6053
6056
fn pending_funding(&self) -> &[FundingScope] {
6054
6057
if let Some(pending_splice) = &self.pending_splice {
6055
- pending_splice.pending_funding .as_slice()
6058
+ pending_splice.negotiated_candidates .as_slice()
6056
6059
} else {
6057
6060
&[]
6058
6061
}
@@ -7305,7 +7308,7 @@ where
7305
7308
*self.funding.next_local_commitment_tx_fee_info_cached.lock().unwrap() = None;
7306
7309
*self.funding.next_remote_commitment_tx_fee_info_cached.lock().unwrap() = None;
7307
7310
if let Some(pending_splice) = self.pending_splice.as_mut() {
7308
- for funding in pending_splice.pending_funding .iter_mut() {
7311
+ for funding in pending_splice.negotiated_candidates .iter_mut() {
7309
7312
*funding.next_local_commitment_tx_fee_info_cached.lock().unwrap() = None;
7310
7313
*funding.next_remote_commitment_tx_fee_info_cached.lock().unwrap() = None;
7311
7314
}
@@ -7512,7 +7515,7 @@ where
7512
7515
self.funding.value_to_self_msat =
7513
7516
(self.funding.value_to_self_msat as i64 + value_to_self_msat_diff) as u64;
7514
7517
if let Some(pending_splice) = self.pending_splice.as_mut() {
7515
- for funding in pending_splice.pending_funding .iter_mut() {
7518
+ for funding in pending_splice.negotiated_candidates .iter_mut() {
7516
7519
funding.value_to_self_msat =
7517
7520
(funding.value_to_self_msat as i64 + value_to_self_msat_diff) as u64;
7518
7521
}
@@ -9553,7 +9556,7 @@ where
9553
9556
9554
9557
let pending_splice = self.pending_splice.as_mut().unwrap();
9555
9558
9556
- debug_assert!(confirmed_funding_index < pending_splice.pending_funding .len());
9559
+ debug_assert!(confirmed_funding_index < pending_splice.negotiated_candidates .len());
9557
9560
9558
9561
let splice_txid = match pending_splice.sent_funding_txid {
9559
9562
Some(sent_funding_txid) => sent_funding_txid,
@@ -9571,7 +9574,8 @@ where
9571
9574
&self.context.channel_id,
9572
9575
);
9573
9576
9574
- let funding = pending_splice.pending_funding.get_mut(confirmed_funding_index).unwrap();
9577
+ let funding =
9578
+ pending_splice.negotiated_candidates.get_mut(confirmed_funding_index).unwrap();
9575
9579
debug_assert_eq!(Some(splice_txid), funding.get_funding_txid());
9576
9580
promote_splice_funding!(self, funding);
9577
9581
@@ -9646,7 +9650,7 @@ where
9646
9650
let mut funding_already_confirmed = false;
9647
9651
#[cfg(splicing)]
9648
9652
if let Some(pending_splice) = &mut self.pending_splice {
9649
- for (index, funding) in pending_splice.pending_funding .iter_mut().enumerate() {
9653
+ for (index, funding) in pending_splice.negotiated_candidates .iter_mut().enumerate() {
9650
9654
if self.context.check_for_funding_tx_confirmed(
9651
9655
funding, block_hash, height, index_in_block, &mut confirmed_tx, logger,
9652
9656
)? {
@@ -9681,7 +9685,7 @@ where
9681
9685
) {
9682
9686
for &(idx, tx) in txdata.iter() {
9683
9687
if idx > index_in_block {
9684
- let funding = pending_splice.pending_funding .get(confirmed_funding_index).unwrap();
9688
+ let funding = pending_splice.negotiated_candidates .get(confirmed_funding_index).unwrap();
9685
9689
self.context.check_for_funding_tx_spent(funding, tx, logger)?;
9686
9690
}
9687
9691
}
@@ -9711,7 +9715,7 @@ where
9711
9715
self.context.check_for_funding_tx_spent(&self.funding, tx, logger)?;
9712
9716
#[cfg(splicing)]
9713
9717
if let Some(pending_splice) = self.pending_splice.as_ref() {
9714
- for funding in pending_splice.pending_funding .iter() {
9718
+ for funding in pending_splice.negotiated_candidates .iter() {
9715
9719
self.context.check_for_funding_tx_spent(funding, tx, logger)?;
9716
9720
}
9717
9721
}
@@ -9840,7 +9844,7 @@ where
9840
9844
return Err(ClosureReason::ProcessingError { err });
9841
9845
},
9842
9846
};
9843
- let funding = pending_splice.pending_funding .get_mut(confirmed_funding_index).unwrap();
9847
+ let funding = pending_splice.negotiated_candidates .get_mut(confirmed_funding_index).unwrap();
9844
9848
9845
9849
// Check if the splice funding transaction was unconfirmed
9846
9850
if funding.get_funding_tx_confirmations(height) == 0 {
@@ -9928,7 +9932,7 @@ where
9928
9932
.or_else(|| {
9929
9933
self.pending_splice.as_mut().and_then(|pending_splice| {
9930
9934
pending_splice
9931
- .pending_funding
9935
+ .negotiated_candidates
9932
9936
.iter_mut()
9933
9937
.find(|funding| funding.get_funding_txid() == Some(*txid))
9934
9938
})
@@ -10288,7 +10292,7 @@ where
10288
10292
self.pending_splice = Some(PendingSplice {
10289
10293
our_funding_contribution: our_funding_contribution_satoshis,
10290
10294
funding: None,
10291
- pending_funding : vec![],
10295
+ negotiated_candidates : vec![],
10292
10296
sent_funding_txid: None,
10293
10297
received_funding_txid: None,
10294
10298
});
@@ -10406,7 +10410,7 @@ where
10406
10410
if let Some(sent_funding_txid) = pending_splice.sent_funding_txid {
10407
10411
if sent_funding_txid == msg.splice_txid {
10408
10412
if let Some(funding) = pending_splice
10409
- .pending_funding
10413
+ .negotiated_candidates
10410
10414
.iter_mut()
10411
10415
.find(|funding| funding.get_funding_txid() == Some(sent_funding_txid))
10412
10416
{
0 commit comments