@@ -2996,6 +2996,8 @@ where
2996
2996
"commitment_signed"
2997
2997
}
2998
2998
2999
+ /// Checks whether the channel was opened through V2 channel open (negotiation).
3000
+ /// See also: is_v2()
2999
3001
fn is_v2_established(&self) -> bool {
3000
3002
let channel_parameters = &self.funding().channel_transaction_parameters;
3001
3003
// This will return false if `counterparty_parameters` is `None`, but for a `FundedChannel`, it
@@ -11144,7 +11146,7 @@ where
11144
11146
}
11145
11147
// We're not allowed to dip below the reserve once we've been above,
11146
11148
// check differently for originally v1 and v2 channels
11147
- if self.is_v2_established () {
11149
+ if self.is_v2 () {
11148
11150
let pre_channel_reserve_sats =
11149
11151
get_v2_channel_reserve_satoshis(pre_channel_value_sats, dust_limit_sats);
11150
11152
if pre_balance_msat >= (pre_channel_reserve_sats * 1000) {
@@ -11992,6 +11994,18 @@ where
11992
11994
// CHANNEL_ANNOUNCEMENT_PROPAGATION_DELAY confirmations.
11993
11995
self.context.historical_scids.drain(0..end)
11994
11996
}
11997
+
11998
+ /// Check is channel is currently v2:
11999
+ /// - established as v2
12000
+ /// - or past a splice (which implicitly makes the channel v2)
12001
+ #[cfg(splicing)]
12002
+ fn is_v2(&self) -> bool {
12003
+ if self.funding.channel_transaction_parameters.splice_parent_funding_txid.is_some() {
12004
+ true
12005
+ } else {
12006
+ self.is_v2_established()
12007
+ }
12008
+ }
11995
12009
}
11996
12010
11997
12011
/// A not-yet-funded outbound (from holder) channel using V1 channel establishment.
0 commit comments