mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-09 20:33:45 +01:00
multi: use new AdditionalEdge interface.
In the previous commit the AdditionalEdge interface was introduced with both of its implementations `BlindedEdge` and `PrivateEdge`. In both cases where we append a route either by a blinded route section or private route hints we now use these new types. In addition the `PayloadSizeFunc` type is introduced in the `unifiedEdge` struct. This is necessary to have the payload size function at hand when searching for a route hence not overshooting the max sphinx package size of 1300 bytes.
This commit is contained in:
@@ -41,15 +41,17 @@ func TestNodeEdgeUnifier(t *testing.T) {
|
||||
c2 := btcutil.Amount(8)
|
||||
|
||||
unifierFilled := newNodeEdgeUnifier(source, toNode, nil)
|
||||
unifierFilled.addPolicy(fromNode, &p1, c1)
|
||||
unifierFilled.addPolicy(fromNode, &p2, c2)
|
||||
unifierFilled.addPolicy(fromNode, &p1, c1, defaultHopPayloadSize)
|
||||
unifierFilled.addPolicy(fromNode, &p2, c2, defaultHopPayloadSize)
|
||||
|
||||
unifierNoCapacity := newNodeEdgeUnifier(source, toNode, nil)
|
||||
unifierNoCapacity.addPolicy(fromNode, &p1, 0)
|
||||
unifierNoCapacity.addPolicy(fromNode, &p2, 0)
|
||||
unifierNoCapacity.addPolicy(fromNode, &p1, 0, defaultHopPayloadSize)
|
||||
unifierNoCapacity.addPolicy(fromNode, &p2, 0, defaultHopPayloadSize)
|
||||
|
||||
unifierNoInfo := newNodeEdgeUnifier(source, toNode, nil)
|
||||
unifierNoInfo.addPolicy(fromNode, &models.CachedEdgePolicy{}, 0)
|
||||
unifierNoInfo.addPolicy(
|
||||
fromNode, &models.CachedEdgePolicy{}, 0, defaultHopPayloadSize,
|
||||
)
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
Reference in New Issue
Block a user