From 9bdb483757f3cf914a0e8484a6d1f3c83bba9022 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Fri, 15 Dec 2017 21:50:21 +0100 Subject: [PATCH] htlcswitch/link: make MinHTLC non-changable This commit specifies that the MinHTLC value for a link is static over the lifetime of a channel, and don't process the field during a policyUpdate. --- htlcswitch/link.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htlcswitch/link.go b/htlcswitch/link.go index 10e8d91bf..f63a1a068 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -39,7 +39,9 @@ const ( // the error possibly carrying along a ChannelUpdate message that includes the // latest policy. type ForwardingPolicy struct { - // MinHTLC is the smallest HTLC that is to be forwarded. + // MinHTLC is the smallest HTLC that is to be forwarded. This is + // set when a channel is first opened, and will be static for the + // lifetime of the channel. MinHTLC lnwire.MilliSatoshi // BaseFee is the base fee, expressed in milli-satoshi that must be @@ -604,9 +606,6 @@ out: // with a "null" field in the new policy, we'll // only update to the set sub policy if the new // value isn't uninitialized. - if req.policy.MinHTLC != 0 { - l.cfg.FwrdingPolicy.MinHTLC = req.policy.MinHTLC - } if req.policy.BaseFee != 0 { l.cfg.FwrdingPolicy.BaseFee = req.policy.BaseFee }