From 9123d6d41bb9f2f3094c38344c23278df84c7ee2 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 28 Sep 2023 00:46:31 +0000 Subject: [PATCH] Don't FC when a `channel_update` has a bogus `htlc_minimum_msat` If a peer sends us a `channel_update` for our own channel with an `htlc_minimum_msat` which is more than the channel's amount, that's dumb, but there's no reason to force-close the channel. We don't even use the field. Here we simply drop the unnecessary check. --- lightning/src/ln/channel.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index d14a86853..55e56be2a 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -5538,9 +5538,6 @@ impl Channel where } pub fn channel_update(&mut self, msg: &msgs::ChannelUpdate) -> Result<(), ChannelError> { - if msg.contents.htlc_minimum_msat >= self.context.channel_value_satoshis * 1000 { - return Err(ChannelError::Close("Minimum htlc value is greater than channel value".to_string())); - } self.context.counterparty_forwarding_info = Some(CounterpartyForwardingInfo { fee_base_msat: msg.contents.fee_base_msat, fee_proportional_millionths: msg.contents.fee_proportional_millionths, -- 2.39.5