multi: move bandwidth hints behind interface

This commit is contained in:
carla
2021-10-19 09:37:44 +02:00
parent e6c65f1cbd
commit 45de686d35
15 changed files with 369 additions and 134 deletions

View File

@@ -133,12 +133,8 @@ func createTestCtxFromGraphInstanceAssumeValid(t *testing.T,
require.NoError(t, err)
sessionSource := &SessionSource{
Graph: cachedGraph,
QueryBandwidth: func(
c *channeldb.DirectedChannel) lnwire.MilliSatoshi {
return lnwire.NewMSatFromSatoshis(c.Capacity)
},
Graph: cachedGraph,
GetLink: graphInstance.getLink,
PathFindingConfig: pathFindingConfig,
MissionControl: mc,
}
@@ -160,11 +156,7 @@ func createTestCtxFromGraphInstanceAssumeValid(t *testing.T,
SessionSource: sessionSource,
ChannelPruneExpiry: time.Hour * 24,
GraphPruneInterval: time.Hour * 2,
QueryBandwidth: func(
e *channeldb.DirectedChannel) lnwire.MilliSatoshi {
return lnwire.NewMSatFromSatoshis(e.Capacity)
},
GetLink: graphInstance.getLink,
NextPaymentID: func() (uint64, error) {
next := atomic.AddUint64(&uniquePaymentID, 1)
return next, nil
@@ -2467,7 +2459,7 @@ func TestFindPathFeeWeighting(t *testing.T) {
// the edge weighting, we should select the direct path over the 2 hop
// path even though the direct path has a higher potential time lock.
path, err := dbFindPath(
ctx.graph, nil, nil,
ctx.graph, nil, &mockBandwidthHints{},
noRestrictions,
testPathFindingConfig,
sourceNode.PubKeyBytes, target, amt, 0,