Skip to content

Commit 1aad61c

Browse files
authored
Merge pull request #9755 from guggero/payment-bandwidth-funding-blob
htlcswitch+routing: add funding blob to PaymentBandwidth
2 parents 9873029 + 56d2381 commit 1aad61c

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

htlcswitch/interfaces.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -512,11 +512,13 @@ type AuxTrafficShaper interface {
512512
fundingBlob, htlcBlob fn.Option[tlv.Blob]) (bool, error)
513513

514514
// PaymentBandwidth returns the available bandwidth for a custom channel
515-
// decided by the given channel aux blob and HTLC blob. A return value
516-
// of 0 means there is no bandwidth available. To find out if a channel
517-
// is a custom channel that should be handled by the traffic shaper, the
518-
// ShouldHandleTraffic method should be called first.
519-
PaymentBandwidth(htlcBlob, commitmentBlob fn.Option[tlv.Blob],
515+
// decided by the given channel funding/commitment aux blob and HTLC
516+
// blob. A return value of 0 means there is no bandwidth available. To
517+
// find out if a channel is a custom channel that should be handled by
518+
// the traffic shaper, the ShouldHandleTraffic method should be called
519+
// first.
520+
PaymentBandwidth(fundingBlob, htlcBlob,
521+
commitmentBlob fn.Option[tlv.Blob],
520522
linkBandwidth, htlcAmt lnwire.MilliSatoshi,
521523
htlcView lnwallet.AuxHtlcView) (lnwire.MilliSatoshi, error)
522524

htlcswitch/link.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3504,7 +3504,7 @@ func (l *channelLink) AuxBandwidth(amount lnwire.MilliSatoshi,
35043504
// Ask for a specific bandwidth to be used for the channel.
35053505
commitmentBlob := l.CommitmentCustomBlob()
35063506
auxBandwidth, err := ts.PaymentBandwidth(
3507-
htlcBlob, commitmentBlob, l.Bandwidth(), amount,
3507+
fundingBlob, htlcBlob, commitmentBlob, l.Bandwidth(), amount,
35083508
l.channel.FetchLatestAuxHTLCView(),
35093509
)
35103510
if err != nil {

routing/bandwidth_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ func (*mockTrafficShaper) ShouldHandleTraffic(_ lnwire.ShortChannelID,
145145
return true, nil
146146
}
147147

148-
// PaymentBandwidth returns the available bandwidth for a custom channel
149-
// decided by the given channel aux blob and HTLC blob. A return value
150-
// of 0 means there is no bandwidth available. To find out if a channel
151-
// is a custom channel that should be handled by the traffic shaper, the
152-
// HandleTraffic method should be called first.
153-
func (*mockTrafficShaper) PaymentBandwidth(_, _ fn.Option[tlv.Blob],
148+
// PaymentBandwidth returns the available bandwidth for a custom channel decided
149+
// by the given channel funding/commitment aux blob and HTLC blob. A return
150+
// value of 0 means there is no bandwidth available. To find out if a channel is
151+
// a custom channel that should be handled by the traffic shaper, the
152+
// ShouldHandleTraffic method should be called first.
153+
func (*mockTrafficShaper) PaymentBandwidth(_, _, _ fn.Option[tlv.Blob],
154154
linkBandwidth, _ lnwire.MilliSatoshi,
155155
_ lnwallet.AuxHtlcView) (lnwire.MilliSatoshi, error) {
156156

0 commit comments

Comments
 (0)