From b271922501807dd2950beff61a2731aa503b1188 Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Wed, 31 Jul 2024 09:32:46 +0200 Subject: [PATCH] routing: dont use InPolicy for blinded paths We only need the ChannelID, so no need to use the InPolicy which might be nil. --- routing/pathfind.go | 4 ++-- routing/router.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/routing/pathfind.go b/routing/pathfind.go index 35b44cf6b..ba9d111c4 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -1156,7 +1156,7 @@ type blindedPathRestrictions struct { // path. type blindedHop struct { vertex route.Vertex - edgePolicy *models.CachedEdgePolicy + channelID uint64 edgeCapacity btcutil.Amount } @@ -1296,7 +1296,7 @@ func processNodeForBlindedPath(g Graph, node route.Vertex, hop := blindedHop{ vertex: channel.OtherNode, - edgePolicy: channel.InPolicy, + channelID: channel.ChannelID, edgeCapacity: channel.Capacity, } diff --git a/routing/router.go b/routing/router.go index 0a0af0d86..3c9be1030 100644 --- a/routing/router.go +++ b/routing/router.go @@ -722,7 +722,7 @@ func (r *ChannelRouter) FindBlindedPaths(destination route.Vertex, hops = append(hops, &route.Hop{ PubKeyBytes: path[j].vertex, - ChannelID: path[j-1].edgePolicy.ChannelID, + ChannelID: path[j-1].channelID, }) prevNode = path[j].vertex