@@ -5301,28 +5301,6 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
5301
5301
self.get_initial_counterparty_commitment_signature(funding, logger)
5302
5302
}
5303
5303
5304
- fn check_funding_meets_minimum_depth(&self, funding: &FundingScope, height: u32) -> bool {
5305
- let minimum_depth = funding.minimum_depth_override
5306
- .or(self.minimum_depth)
5307
- .expect("ChannelContext::minimum_depth should be set for FundedChannel");
5308
-
5309
- // Zero-conf channels always meet the minimum depth.
5310
- if minimum_depth == 0 {
5311
- return true;
5312
- }
5313
-
5314
- if funding.funding_tx_confirmation_height == 0 {
5315
- return false;
5316
- }
5317
-
5318
- let funding_tx_confirmations = height as i64 - funding.funding_tx_confirmation_height as i64 + 1;
5319
- if funding_tx_confirmations < minimum_depth as i64 {
5320
- return false;
5321
- }
5322
-
5323
- return true;
5324
- }
5325
-
5326
5304
fn check_for_funding_tx_confirmed(
5327
5305
&mut self, funding: &mut FundingScope, block_hash: &BlockHash, height: u32,
5328
5306
index_in_block: usize, tx: &mut ConfirmedTransaction,
@@ -8625,7 +8603,7 @@ impl<SP: Deref> FundedChannel<SP> where
8625
8603
// Called:
8626
8604
// * always when a new block/transactions are confirmed with the new height
8627
8605
// * when funding is signed with a height of 0
8628
- if !self.context. check_funding_meets_minimum_depth(&self.funding, height) {
8606
+ if !self.check_funding_meets_minimum_depth(&self.funding, height) {
8629
8607
return None;
8630
8608
}
8631
8609
@@ -8698,7 +8676,7 @@ impl<SP: Deref> FundedChannel<SP> where
8698
8676
fn check_get_splice_locked(
8699
8677
&self, pending_splice: &PendingSplice, funding: &FundingScope, height: u32,
8700
8678
) -> Option<msgs::SpliceLocked> {
8701
- if !self.context. check_funding_meets_minimum_depth(funding, height) {
8679
+ if !self.check_funding_meets_minimum_depth(funding, height) {
8702
8680
return None;
8703
8681
}
8704
8682
@@ -8721,6 +8699,28 @@ impl<SP: Deref> FundedChannel<SP> where
8721
8699
}
8722
8700
}
8723
8701
8702
+ fn check_funding_meets_minimum_depth(&self, funding: &FundingScope, height: u32) -> bool {
8703
+ let minimum_depth = funding.minimum_depth_override
8704
+ .or(self.context.minimum_depth)
8705
+ .expect("ChannelContext::minimum_depth should be set for FundedChannel");
8706
+
8707
+ // Zero-conf channels always meet the minimum depth.
8708
+ if minimum_depth == 0 {
8709
+ return true;
8710
+ }
8711
+
8712
+ if funding.funding_tx_confirmation_height == 0 {
8713
+ return false;
8714
+ }
8715
+
8716
+ let funding_tx_confirmations = height as i64 - funding.funding_tx_confirmation_height as i64 + 1;
8717
+ if funding_tx_confirmations < minimum_depth as i64 {
8718
+ return false;
8719
+ }
8720
+
8721
+ return true;
8722
+ }
8723
+
8724
8724
#[cfg(splicing)]
8725
8725
fn maybe_promote_splice_funding<L: Deref>(
8726
8726
&mut self, splice_txid: Txid, confirmed_funding_index: usize, logger: &L,
0 commit comments