mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
htlcswitch: add HtlcView as PaymentBandwidth argument
In order to get more precise bandwidth reports, we also need to provide this method with the latest htlc view. Since aux data is committed to in the channel commitment, some uncommited HTLCs may not be accounted for, so we need to manually provide them via the HTLC view.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/go-errors/errors"
|
||||
"github.com/lightningnetwork/lnd/fn/v2"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/tlv"
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -150,7 +151,8 @@ func (*mockTrafficShaper) ShouldHandleTraffic(_ lnwire.ShortChannelID,
|
||||
// is a custom channel that should be handled by the traffic shaper, the
|
||||
// HandleTraffic method should be called first.
|
||||
func (*mockTrafficShaper) PaymentBandwidth(_, _ fn.Option[tlv.Blob],
|
||||
linkBandwidth, _ lnwire.MilliSatoshi) (lnwire.MilliSatoshi, error) {
|
||||
linkBandwidth, _ lnwire.MilliSatoshi,
|
||||
_ lnwallet.AuxHtlcView) (lnwire.MilliSatoshi, error) {
|
||||
|
||||
return linkBandwidth, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user