@@ -5511,30 +5511,6 @@ where
5511
5511
self.get_initial_counterparty_commitment_signature(funding, logger)
5512
5512
}
5513
5513
5514
- fn check_funding_meets_minimum_depth(&self, funding: &FundingScope, height: u32) -> bool {
5515
- let minimum_depth = funding
5516
- .minimum_depth_override
5517
- .or(self.minimum_depth)
5518
- .expect("ChannelContext::minimum_depth should be set for FundedChannel");
5519
-
5520
- // Zero-conf channels always meet the minimum depth.
5521
- if minimum_depth == 0 {
5522
- return true;
5523
- }
5524
-
5525
- if funding.funding_tx_confirmation_height == 0 {
5526
- return false;
5527
- }
5528
-
5529
- let funding_tx_confirmations =
5530
- height as i64 - funding.funding_tx_confirmation_height as i64 + 1;
5531
- if funding_tx_confirmations < minimum_depth as i64 {
5532
- return false;
5533
- }
5534
-
5535
- return true;
5536
- }
5537
-
5538
5514
#[rustfmt::skip]
5539
5515
fn check_for_funding_tx_confirmed(
5540
5516
&mut self, funding: &mut FundingScope, block_hash: &BlockHash, height: u32,
@@ -8949,7 +8925,7 @@ where
8949
8925
// Called:
8950
8926
// * always when a new block/transactions are confirmed with the new height
8951
8927
// * when funding is signed with a height of 0
8952
- if !self.context. check_funding_meets_minimum_depth(&self.funding, height) {
8928
+ if !self.check_funding_meets_minimum_depth(&self.funding, height) {
8953
8929
return None;
8954
8930
}
8955
8931
@@ -9023,7 +8999,7 @@ where
9023
8999
fn check_get_splice_locked(
9024
9000
&self, pending_splice: &PendingSplice, funding: &FundingScope, height: u32,
9025
9001
) -> Option<msgs::SpliceLocked> {
9026
- if !self.context. check_funding_meets_minimum_depth(funding, height) {
9002
+ if !self.check_funding_meets_minimum_depth(funding, height) {
9027
9003
return None;
9028
9004
}
9029
9005
@@ -9044,6 +9020,30 @@ where
9044
9020
}
9045
9021
}
9046
9022
9023
+ fn check_funding_meets_minimum_depth(&self, funding: &FundingScope, height: u32) -> bool {
9024
+ let minimum_depth = funding
9025
+ .minimum_depth_override
9026
+ .or(self.context.minimum_depth)
9027
+ .expect("ChannelContext::minimum_depth should be set for FundedChannel");
9028
+
9029
+ // Zero-conf channels always meet the minimum depth.
9030
+ if minimum_depth == 0 {
9031
+ return true;
9032
+ }
9033
+
9034
+ if funding.funding_tx_confirmation_height == 0 {
9035
+ return false;
9036
+ }
9037
+
9038
+ let funding_tx_confirmations =
9039
+ height as i64 - funding.funding_tx_confirmation_height as i64 + 1;
9040
+ if funding_tx_confirmations < minimum_depth as i64 {
9041
+ return false;
9042
+ }
9043
+
9044
+ return true;
9045
+ }
9046
+
9047
9047
#[cfg(splicing)]
9048
9048
fn maybe_promote_splice_funding<L: Deref>(
9049
9049
&mut self, splice_txid: Txid, confirmed_funding_index: usize, logger: &L,
0 commit comments