Skip to content

Commit 3a4de75

Browse files
committed
Reduce force-closures with user fee estimators which round poorly
See comment for more
1 parent 3ec529d commit 3a4de75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,11 @@ impl<Signer: Sign> Channel<Signer> {
862862
where F::Target: FeeEstimator
863863
{
864864
let lower_limit = fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::Background);
865-
if feerate_per_kw < lower_limit {
865+
// Some fee estimators round up to the next full sat/vbyte (ie 250 sats per kw), causing
866+
// occasional issues with feerate disagreements between an initiator that wants a feerate
867+
// of 1.1 sat/vbyte and a receiver that wants 1.1 rounded up to 2. Thus, we always add 250
868+
// sat/kw before the comparison here.
869+
if feerate_per_kw + 250 < lower_limit {
866870
return Err(ChannelError::Close(format!("Peer's feerate much too low. Actual: {}. Our expected lower limit: {}", feerate_per_kw, lower_limit)));
867871
}
868872
// We only bound the fee updates on the upper side to prevent completely absurd feerates,

0 commit comments

Comments
 (0)