@@ -5499,30 +5499,6 @@ where
5499
5499
self.get_initial_counterparty_commitment_signature(funding, logger)
5500
5500
}
5501
5501
5502
- fn check_funding_meets_minimum_depth(&self, funding: &FundingScope, height: u32) -> bool {
5503
- let minimum_depth = funding
5504
- .minimum_depth_override
5505
- .or(self.minimum_depth)
5506
- .expect("ChannelContext::minimum_depth should be set for FundedChannel");
5507
-
5508
- // Zero-conf channels always meet the minimum depth.
5509
- if minimum_depth == 0 {
5510
- return true;
5511
- }
5512
-
5513
- if funding.funding_tx_confirmation_height == 0 {
5514
- return false;
5515
- }
5516
-
5517
- let funding_tx_confirmations =
5518
- height as i64 - funding.funding_tx_confirmation_height as i64 + 1;
5519
- if funding_tx_confirmations < minimum_depth as i64 {
5520
- return false;
5521
- }
5522
-
5523
- return true;
5524
- }
5525
-
5526
5502
#[rustfmt::skip]
5527
5503
fn check_for_funding_tx_confirmed(
5528
5504
&mut self, funding: &mut FundingScope, block_hash: &BlockHash, height: u32,
@@ -8905,7 +8881,7 @@ where
8905
8881
// Called:
8906
8882
// * always when a new block/transactions are confirmed with the new height
8907
8883
// * when funding is signed with a height of 0
8908
- if !self.context. check_funding_meets_minimum_depth(&self.funding, height) {
8884
+ if !self.check_funding_meets_minimum_depth(&self.funding, height) {
8909
8885
return None;
8910
8886
}
8911
8887
@@ -8979,7 +8955,7 @@ where
8979
8955
fn check_get_splice_locked(
8980
8956
&self, pending_splice: &PendingSplice, funding: &FundingScope, height: u32,
8981
8957
) -> Option<msgs::SpliceLocked> {
8982
- if !self.context. check_funding_meets_minimum_depth(funding, height) {
8958
+ if !self.check_funding_meets_minimum_depth(funding, height) {
8983
8959
return None;
8984
8960
}
8985
8961
@@ -9000,6 +8976,30 @@ where
9000
8976
}
9001
8977
}
9002
8978
8979
+ fn check_funding_meets_minimum_depth(&self, funding: &FundingScope, height: u32) -> bool {
8980
+ let minimum_depth = funding
8981
+ .minimum_depth_override
8982
+ .or(self.context.minimum_depth)
8983
+ .expect("ChannelContext::minimum_depth should be set for FundedChannel");
8984
+
8985
+ // Zero-conf channels always meet the minimum depth.
8986
+ if minimum_depth == 0 {
8987
+ return true;
8988
+ }
8989
+
8990
+ if funding.funding_tx_confirmation_height == 0 {
8991
+ return false;
8992
+ }
8993
+
8994
+ let funding_tx_confirmations =
8995
+ height as i64 - funding.funding_tx_confirmation_height as i64 + 1;
8996
+ if funding_tx_confirmations < minimum_depth as i64 {
8997
+ return false;
8998
+ }
8999
+
9000
+ return true;
9001
+ }
9002
+
9003
9003
#[cfg(splicing)]
9004
9004
fn maybe_promote_splice_funding<L: Deref>(
9005
9005
&mut self, splice_txid: Txid, confirmed_funding_index: usize, logger: &L,
0 commit comments