From a6cf6f4237ef53b1f0c51c2fcfb9c1ce73cf9e06 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 25 Feb 2019 12:51:07 -0300 Subject: [PATCH] lnwallet+peer: remove unnecessary MaxPendingAmount method We don't need this method, as we can directly access it from the peer via public fields with its current usage. --- lnwallet/channel.go | 6 ------ peer.go | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index b3b79682..8a9bcddb 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -6336,9 +6336,3 @@ func (lc *LightningChannel) RemoteCommitHeight() uint64 { func (lc *LightningChannel) FwdMinHtlc() lnwire.MilliSatoshi { return lc.localChanCfg.MinHTLC } - -// MaxPendingAmount returns the maximum HTLC value that can be pending at -// any time over this channel. -func (lc *LightningChannel) MaxPendingAmount() lnwire.MilliSatoshi { - return lc.localChanCfg.MaxPendingAmount -} diff --git a/peer.go b/peer.go index c0453eb3..504276fd 100644 --- a/peer.go +++ b/peer.go @@ -1710,7 +1710,7 @@ out: defaultPolicy := p.server.cc.routingPolicy forwardingPolicy := &htlcswitch.ForwardingPolicy{ MinHTLC: fwdMinHtlc, - MaxHTLC: lnChan.MaxPendingAmount(), + MaxHTLC: newChan.LocalChanCfg.MaxPendingAmount, BaseFee: defaultPolicy.BaseFee, FeeRate: defaultPolicy.FeeRate, TimeLockDelta: defaultPolicy.TimeLockDelta,