Skip to content

Commit 02208ab

Browse files
committed
Relax MaximumFeeEstimate confirmation target estimation
`MaximumFeeEstimate` is mostly used for protection against fee-inflation attacks. As users were previously impacted by this limit being too restrictive (read: too low), we bump it here a bit to give them some leeway.
1 parent fdaa759 commit 02208ab

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/fee_estimator.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,17 @@ pub(crate) fn apply_post_estimation_adjustments(
150150
.max(FEERATE_FLOOR_SATS_PER_KW as u64);
151151
FeeRate::from_sat_per_kwu(slightly_less_than_background)
152152
},
153+
ConfirmationTarget::Lightning(LdkConfirmationTarget::MaximumFeeEstimate) => {
154+
// MaximumFeeEstimate is mostly used for protection against fee-inflation attacks. As
155+
// users were previously impacted by this limit being too restrictive (read: too low),
156+
// we bump it here a bit to give them some leeway.
157+
let slightly_bump = estimated_rate
158+
.to_sat_per_kwu()
159+
.saturating_mul(11)
160+
.saturating_div(10)
161+
.saturating_add(2500);
162+
FeeRate::from_sat_per_kwu(slightly_bump)
163+
},
153164
_ => estimated_rate,
154165
}
155166
}

0 commit comments

Comments
 (0)