mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 06:32:18 +02:00
Merge pull request #9687 from GeorgeTsagk/aux-trff-shpr-htlcview
`AuxTrafficShaper.PaymentBandwidth` uses HTLC view
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/graph/db/models"
|
||||
"github.com/lightningnetwork/lnd/invoices"
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/record"
|
||||
@@ -516,8 +517,8 @@ type AuxTrafficShaper interface {
|
||||
// is a custom channel that should be handled by the traffic shaper, the
|
||||
// ShouldHandleTraffic method should be called first.
|
||||
PaymentBandwidth(htlcBlob, commitmentBlob fn.Option[tlv.Blob],
|
||||
linkBandwidth,
|
||||
htlcAmt lnwire.MilliSatoshi) (lnwire.MilliSatoshi, error)
|
||||
linkBandwidth, htlcAmt lnwire.MilliSatoshi,
|
||||
htlcView lnwallet.AuxHtlcView) (lnwire.MilliSatoshi, error)
|
||||
|
||||
// IsCustomHTLC returns true if the HTLC carries the set of relevant
|
||||
// custom records to put it under the purview of the traffic shaper,
|
||||
|
@@ -3505,6 +3505,7 @@ func (l *channelLink) AuxBandwidth(amount lnwire.MilliSatoshi,
|
||||
commitmentBlob := l.CommitmentCustomBlob()
|
||||
auxBandwidth, err := ts.PaymentBandwidth(
|
||||
htlcBlob, commitmentBlob, l.Bandwidth(), amount,
|
||||
l.channel.FetchLatestAuxHTLCView(),
|
||||
)
|
||||
if err != nil {
|
||||
return fn.Err[OptionalBandwidth](fmt.Errorf("failed to get "+
|
||||
|
Reference in New Issue
Block a user