multi: move routing.TlvTrafficShaper => htlcswitch.AuxTrafficShaper

With this commit we move the traffic shaper definition from the routing
package to the HTLC switch package as a preparation for being able to
use it there as well.
At the same time we rename it to AuxTrafficShaper to be more in line
with the other auxiliary components.
This commit is contained in:
Oliver Gugger
2024-12-03 13:23:01 +01:00
parent fa309c9a0e
commit 117c6bc781
12 changed files with 167 additions and 99 deletions

View File

@@ -761,7 +761,8 @@ func (p *paymentLifecycle) amendFirstHopData(rt *route.Route) error {
// and apply its side effects to the UpdateAddHTLC message.
result, err := fn.MapOptionZ(
p.router.cfg.TrafficShaper,
func(ts TlvTrafficShaper) fn.Result[extraDataRequest] {
//nolint:ll
func(ts htlcswitch.AuxTrafficShaper) fn.Result[extraDataRequest] {
newAmt, newRecords, err := ts.ProduceHtlcExtraData(
rt.TotalAmount, p.firstHopCustomRecords,
)
@@ -774,7 +775,7 @@ func (p *paymentLifecycle) amendFirstHopData(rt *route.Route) error {
return fn.Err[extraDataRequest](err)
}
log.Debugf("TLV traffic shaper returned custom "+
log.Debugf("Aux traffic shaper returned custom "+
"records %v and amount %d msat for HTLC",
spew.Sdump(newRecords), newAmt)