Skip to content

Commit 0ddf784

Browse files
committed
f Use FEERATE_FLOOR_SATS_PER_KW
1 parent ce89f6c commit 0ddf784

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/access.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::logger::{
55
Logger,
66
};
77

8-
use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator};
8+
use lightning::chain::chaininterface::{BroadcasterInterface, ConfirmationTarget, FeeEstimator, FEERATE_FLOOR_SATS_PER_KW};
99
use lightning::chain::WatchedOutput;
1010
use lightning::chain::{Confirm, Filter};
1111

@@ -19,9 +19,6 @@ use bitcoin::{BlockHash, Script, Transaction, Txid};
1919
use std::collections::HashSet;
2020
use std::sync::{Arc, Mutex};
2121

22-
/// The minimum feerate we are allowed to send, as specify by LDK.
23-
const MIN_FEERATE: u32 = 253;
24-
2522
pub struct LdkLiteChainAccess<D>
2623
where
2724
D: BatchDatabase,
@@ -283,7 +280,7 @@ where
283280
let fallback_fee = fallback_fee_from_conf_target(confirmation_target);
284281
self.blockchain
285282
.estimate_fee(num_blocks)
286-
.map_or(fallback_fee, |fee_rate| (fee_rate.fee_wu(1000) as u32).max(MIN_FEERATE)) as u32
283+
.map_or(fallback_fee, |fee_rate| (fee_rate.fee_wu(1000) as u32).max(FEERATE_FLOOR_SATS_PER_KW)) as u32
287284
}
288285
}
289286

@@ -325,7 +322,7 @@ fn num_blocks_from_conf_target(confirmation_target: ConfirmationTarget) -> usize
325322

326323
fn fallback_fee_from_conf_target(confirmation_target: ConfirmationTarget) -> u32 {
327324
match confirmation_target {
328-
ConfirmationTarget::Background => MIN_FEERATE,
325+
ConfirmationTarget::Background => FEERATE_FLOOR_SATS_PER_KW,
329326
ConfirmationTarget::Normal => 2000,
330327
ConfirmationTarget::HighPriority => 5000,
331328
}

0 commit comments

Comments
 (0)