htlcswitch+routing: add htlc blob to ShouldHandleTraffic
Whether we should let the aux bandwidth manager decide what the bandwidth of a channel is should also depend on whether the HTLC is a custom HTLC, not just the channel.
This commit is contained in:
3 files changed
+3
-3
No files matched your search
@@ -509,7 +509,7 @@ type AuxTrafficShaper interface {
|
|||||||
// identified by the provided channel ID may have external mechanisms
|
// identified by the provided channel ID may have external mechanisms
|
||||||
// that would allow it to carry out the payment.
|
// that would allow it to carry out the payment.
|
||||||
ShouldHandleTraffic(cid lnwire.ShortChannelID,
|
ShouldHandleTraffic(cid lnwire.ShortChannelID,
|
||||||
fundingBlob fn.Option[tlv.Blob]) (bool, error)
|
fundingBlob, htlcBlob fn.Option[tlv.Blob]) (bool, error)
|
||||||
|
|
||||||
// PaymentBandwidth returns the available bandwidth for a custom channel
|
// PaymentBandwidth returns the available bandwidth for a custom channel
|
||||||
// decided by the given channel aux blob and HTLC blob. A return value
|
// decided by the given channel aux blob and HTLC blob. A return value
|
||||||
|
|||||||
+1
-1
@@ -3484,7 +3484,7 @@ func (l *channelLink) AuxBandwidth(amount lnwire.MilliSatoshi,
|
|||||||
ts AuxTrafficShaper) fn.Result[OptionalBandwidth] {
|
ts AuxTrafficShaper) fn.Result[OptionalBandwidth] {
|
||||||
|
|
||||||
fundingBlob := l.FundingCustomBlob()
|
fundingBlob := l.FundingCustomBlob()
|
||||||
shouldHandle, err := ts.ShouldHandleTraffic(cid, fundingBlob)
|
shouldHandle, err := ts.ShouldHandleTraffic(cid, fundingBlob, htlcBlob)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fn.Err[OptionalBandwidth](fmt.Errorf("traffic shaper "+
|
return fn.Err[OptionalBandwidth](fmt.Errorf("traffic shaper "+
|
||||||
"failed to decide whether to handle traffic: %w", err))
|
"failed to decide whether to handle traffic: %w", err))
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ type mockTrafficShaper struct{}
|
|||||||
// by the provided channel ID may have external mechanisms that would
|
// by the provided channel ID may have external mechanisms that would
|
||||||
// allow it to carry out the payment.
|
// allow it to carry out the payment.
|
||||||
func (*mockTrafficShaper) ShouldHandleTraffic(_ lnwire.ShortChannelID,
|
func (*mockTrafficShaper) ShouldHandleTraffic(_ lnwire.ShortChannelID,
|
||||||
_ fn.Option[tlv.Blob]) (bool, error) {
|
_, _ fn.Option[tlv.Blob]) (bool, error) {
|
||||||
|
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user