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.
This commit is contained in:
Johan T. Halseth 2017-12-15 21:50:21 +01:00
parent a3f2bdebbf
commit 9bdb483757
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26
1 changed files with 3 additions and 4 deletions

View File

@ -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
}