@@ -2761,6 +2761,8 @@ where
2761
2761
"commitment_signed"
2762
2762
}
2763
2763
2764
+ /// Checks whether the channel was opened through V2 channel open (negotiation).
2765
+ /// See also: [`is_v2`]
2764
2766
fn is_v2_established(&self) -> bool {
2765
2767
let channel_parameters = &self.funding().channel_transaction_parameters;
2766
2768
// This will return false if `counterparty_parameters` is `None`, but for a `FundedChannel`, it
@@ -10591,7 +10593,7 @@ where
10591
10593
}
10592
10594
// We're not allowed to dip below the reserve once we've been above,
10593
10595
// check differently for originally v1 and v2 channels
10594
- if self.is_v2_established () {
10596
+ if self.is_v2 () {
10595
10597
let pre_channel_reserve_sats =
10596
10598
get_v2_channel_reserve_satoshis(pre_channel_value_sats, dust_limit_sats);
10597
10599
if pre_balance_msat >= (pre_channel_reserve_sats * 1000) {
@@ -11386,6 +11388,18 @@ where
11386
11388
// CHANNEL_ANNOUNCEMENT_PROPAGATION_DELAY confirmations.
11387
11389
self.context.historical_scids.drain(0..end)
11388
11390
}
11391
+
11392
+ /// Check is channel is currently v2:
11393
+ /// - established as v2
11394
+ /// - or past a splice (which implicitly makes the channel v2)
11395
+ #[cfg(splicing)]
11396
+ fn is_v2(&self) -> bool {
11397
+ if self.funding.channel_transaction_parameters.splice_parent_funding_txid.is_some() {
11398
+ true
11399
+ } else {
11400
+ self.is_v2_established()
11401
+ }
11402
+ }
11389
11403
}
11390
11404
11391
11405
/// A not-yet-funded outbound (from holder) channel using V1 channel establishment.
0 commit comments