Merge pull request #2434 from valentinewallace/fwding-policy-max-htlc

Set max HTLC in forwarding policies.
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2019-02-25 12:43:15 -03:00
commit b13d8cd261
10 files changed
+699 -564

No files matched your search

+8 -5
View File
@@ -488,6 +488,7 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error {
if selfPolicy != nil {
forwardingPolicy = &htlcswitch.ForwardingPolicy{
MinHTLC: selfPolicy.MinHTLC,
MaxHTLC: selfPolicy.MaxHTLC,
BaseFee: selfPolicy.FeeBaseMSat,
FeeRate: selfPolicy.FeeProportionalMillionths,
TimeLockDelta: uint32(selfPolicy.TimeLockDelta),
@@ -1699,15 +1700,17 @@ out:
continue
}
// We'll query the localChanCfg of the new channel to
// determine the minimum HTLC value that can be
// forwarded. For fees we'll use the default values, as
// they currently are always set to the default values
// at initial channel creation.
// We'll query the localChanCfg of the new channel to determine the
// minimum HTLC value that can be forwarded. For the maximum HTLC
// value that can be forwarded and fees we'll use the default
// values, as they currently are always set to the default values
// at initial channel creation. Note that the maximum HTLC value
// defaults to the cap on the total value of outstanding HTLCs.
fwdMinHtlc := lnChan.FwdMinHtlc()
defaultPolicy := p.server.cc.routingPolicy
forwardingPolicy := &htlcswitch.ForwardingPolicy{
MinHTLC: fwdMinHtlc,
MaxHTLC: lnChan.MaxPendingAmount(),
BaseFee: defaultPolicy.BaseFee,
FeeRate: defaultPolicy.FeeRate,
TimeLockDelta: defaultPolicy.TimeLockDelta,