@@ -2757,6 +2757,8 @@ where
2757
2757
"commitment_signed"
2758
2758
}
2759
2759
2760
+ /// Checks whether the channel was opened through V2 channel open (negotiation).
2761
+ /// See also: is_v2()
2760
2762
fn is_v2_established(&self) -> bool {
2761
2763
let channel_parameters = &self.funding().channel_transaction_parameters;
2762
2764
// This will return false if `counterparty_parameters` is `None`, but for a `FundedChannel`, it
@@ -10751,7 +10753,7 @@ where
10751
10753
}
10752
10754
// We're not allowed to dip below the reserve once we've been above,
10753
10755
// check differently for originally v1 and v2 channels
10754
- if self.is_v2_established () {
10756
+ if self.is_v2 () {
10755
10757
let pre_channel_reserve_sats =
10756
10758
get_v2_channel_reserve_satoshis(pre_channel_value_sats, dust_limit_sats);
10757
10759
if pre_balance_msat >= (pre_channel_reserve_sats * 1000) {
@@ -11599,6 +11601,18 @@ where
11599
11601
// CHANNEL_ANNOUNCEMENT_PROPAGATION_DELAY confirmations.
11600
11602
self.context.historical_scids.drain(0..end)
11601
11603
}
11604
+
11605
+ /// Check is channel is currently v2:
11606
+ /// - established as v2
11607
+ /// - or past a splice (which implicitly makes the channel v2)
11608
+ #[cfg(splicing)]
11609
+ fn is_v2(&self) -> bool {
11610
+ if self.funding.channel_transaction_parameters.splice_parent_funding_txid.is_some() {
11611
+ true
11612
+ } else {
11613
+ self.is_v2_established()
11614
+ }
11615
+ }
11602
11616
}
11603
11617
11604
11618
/// A not-yet-funded outbound (from holder) channel using V1 channel establishment.
0 commit comments