htlcswitch+routing: return IsHandled from AuxBandwidth

To make it more clear whether the external traffic shaper is handling a
channel or not, we return an explicit boolean.
This commit is contained in:
Oliver Gugger committed 2025-03-13 12:26:50 -05:00
1 parent 6531d45050
commit dac5de5ce9
5 files changed
+36 -14

No files matched your search

+8 -1
View File
@@ -143,6 +143,13 @@ func (b *bandwidthManager) getBandwidth(cid lnwire.ShortChannelID,
"auxiliary bandwidth: %w", err))
}
// If the external traffic shaper is not handling the
// channel, we'll just return the original bandwidth and
// no custom amount.
if !auxBandwidth.IsHandled {
return fn.Ok(bandwidthResult{})
}
// We don't know the actual HTLC amount that will be
// sent using the custom channel. But we'll still want
// to make sure we can add another HTLC, using the
@@ -152,7 +159,7 @@ func (b *bandwidthManager) getBandwidth(cid lnwire.ShortChannelID,
// the max number of HTLCs on the channel. A proper
// balance check is done elsewhere.
return fn.Ok(bandwidthResult{
bandwidth: auxBandwidth,
bandwidth: auxBandwidth.Bandwidth,
htlcAmount: fn.Some[lnwire.MilliSatoshi](0),
})
},