mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-02 19:44:03 +02: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:
@ -163,7 +163,7 @@ type PaymentSession interface {
|
||||
// loop if payment attempts take long enough. An additional set of edges can
|
||||
// also be provided to assist in reaching the payment's destination.
|
||||
type paymentSession struct {
|
||||
additionalEdges map[route.Vertex][]*models.CachedEdgePolicy
|
||||
additionalEdges map[route.Vertex][]AdditionalEdge
|
||||
|
||||
getBandwidthHints func(routingGraph) (bandwidthHints, error)
|
||||
|
||||
@ -441,11 +441,12 @@ func (p *paymentSession) GetAdditionalEdgePolicy(pubKey *btcec.PublicKey,
|
||||
}
|
||||
|
||||
for _, edge := range edges {
|
||||
if edge.ChannelID != channelID {
|
||||
policy := edge.EdgePolicy()
|
||||
if policy.ChannelID != channelID {
|
||||
continue
|
||||
}
|
||||
|
||||
return edge
|
||||
return policy
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user