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:
1 file changed
+3
-4
+3
-4
@@ -39,7 +39,9 @@ const (
|
|||||||
// the error possibly carrying along a ChannelUpdate message that includes the
|
// the error possibly carrying along a ChannelUpdate message that includes the
|
||||||
// latest policy.
|
// latest policy.
|
||||||
type ForwardingPolicy struct {
|
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
|
MinHTLC lnwire.MilliSatoshi
|
||||||
|
|
||||||
// BaseFee is the base fee, expressed in milli-satoshi that must be
|
// 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
|
// with a "null" field in the new policy, we'll
|
||||||
// only update to the set sub policy if the new
|
// only update to the set sub policy if the new
|
||||||
// value isn't uninitialized.
|
// value isn't uninitialized.
|
||||||
if req.policy.MinHTLC != 0 {
|
|
||||||
l.cfg.FwrdingPolicy.MinHTLC = req.policy.MinHTLC
|
|
||||||
}
|
|
||||||
if req.policy.BaseFee != 0 {
|
if req.policy.BaseFee != 0 {
|
||||||
l.cfg.FwrdingPolicy.BaseFee = req.policy.BaseFee
|
l.cfg.FwrdingPolicy.BaseFee = req.policy.BaseFee
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user