From 37aa49c7aa49464d1c5fbb069f666087b4f30541 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Tue, 13 Apr 2021 15:53:18 +0800 Subject: [PATCH] routing: fix pathfind edge features being nil --- routing/pathfind.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/routing/pathfind.go b/routing/pathfind.go index cfc7afae..387e7150 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -144,7 +144,14 @@ func newRoute(sourceVertex route.Vertex, // vector for support for a given feature. We assume at this // point that the feature vectors transitive dependencies have // been validated. - supports := edge.Node.Features.HasFeature + supports := func(feature lnwire.FeatureBit) bool { + // If this edge comes from router hints, the features + // could be nil. + if edge.Node.Features == nil { + return false + } + return edge.Node.Features.HasFeature(feature) + } // We start by assuming the node doesn't support TLV. We'll now // inspect the node's feature vector to see if we can promote