routing: use self instead of source node for creating unified policy

A unified policy differs between local channels and other channels on
the network. There is more information available for local channels and
this is used in the unified policy.

Previously we used the pathfinding source pubkey to determine whether to
apply the local channel logic or not. If queryroutes is executed with a
source node that isn't the self node, this wouldn't work.
This commit is contained in:
Joost Jager 2019-11-21 13:43:33 +01:00
parent 97344af8f3
commit 9ae014edf6
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -617,7 +617,7 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
pivot := partialPath.node
// Create unified policies for all incoming connections.
u := newUnifiedPolicies(source, pivot, r.OutgoingChannelID)
u := newUnifiedPolicies(self, pivot, r.OutgoingChannelID)
err := u.addGraphPolicies(g.graph, tx)
if err != nil {