@@ -122,14 +122,8 @@ where
122
122
ConfirmationTarget :: HighPriority ,
123
123
] ;
124
124
for target in confirmation_targets {
125
- let num_blocks = match target {
126
- ConfirmationTarget :: MempoolMinimum => 1008 ,
127
- ConfirmationTarget :: Background => 144 ,
128
- ConfirmationTarget :: Normal => 12 ,
129
- ConfirmationTarget :: HighPriority => 1 ,
130
- } ;
131
-
132
- let est_fee_rate = self . blockchain . estimate_fee ( num_blocks) . await ;
125
+ let num_blocks = num_blocks_from_conf_target ( target) ;
126
+ let est_fee_rate = self . blockchain . estimate_fee ( num_blocks as usize ) . await ;
133
127
134
128
match est_fee_rate {
135
129
Ok ( rate) => {
@@ -347,6 +341,15 @@ where
347
341
}
348
342
}
349
343
344
+ pub ( crate ) fn num_blocks_from_conf_target ( target : ConfirmationTarget ) -> u32 {
345
+ match target {
346
+ ConfirmationTarget :: MempoolMinimum => 1008 ,
347
+ ConfirmationTarget :: Background => 144 ,
348
+ ConfirmationTarget :: Normal => 12 ,
349
+ ConfirmationTarget :: HighPriority => 1 ,
350
+ }
351
+ }
352
+
350
353
/// Similar to [`KeysManager`], but overrides the destination and shutdown scripts so they are
351
354
/// directly spendable by the BDK wallet.
352
355
pub struct WalletKeysManager < D , L : Deref >
0 commit comments