]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Don't FC when a `channel_update` has a bogus `htlc_minimum_msat`
authorMatt Corallo <git@bluematt.me>
Thu, 28 Sep 2023 00:46:31 +0000 (00:46 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 28 Sep 2023 00:47:43 +0000 (00:47 +0000)
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

index d14a868539f68f173fcb79e481e2056aa3f8f090..55e56be2a79377079377591f14ad1fef33311f17 100644 (file)
@@ -5538,9 +5538,6 @@ impl<SP: Deref> Channel<SP> 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,