From 9ae014edf6e35df59c879e40bda1dda5926deab2 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Thu, 21 Nov 2019 13:43:33 +0100 Subject: [PATCH] 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. --- routing/pathfind.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing/pathfind.go b/routing/pathfind.go index e794f814..583c5387 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -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 {