Skip to content

Commit 15c3e0e

Browse files
committed
Also ensure post-estimation fee rate tweaks can never undeflow
1 parent c14297b commit 15c3e0e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/fee_estimator.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ pub(crate) fn apply_post_estimation_adjustments(
144144
ConfirmationTarget::Lightning(
145145
LdkConfirmationTarget::MinAllowedNonAnchorChannelRemoteFee,
146146
) => {
147-
let slightly_less_than_background = estimated_rate.to_sat_per_kwu() - 250;
147+
let slightly_less_than_background = estimated_rate
148+
.to_sat_per_kwu()
149+
.saturating_sub(250)
150+
.max(FEERATE_FLOOR_SATS_PER_KW as u64);
148151
FeeRate::from_sat_per_kwu(slightly_less_than_background)
149152
},
150153
_ => estimated_rate,

0 commit comments

Comments
 (0)