From 0c7fcb1755d4a93d0e7206e454bf5848864da36a Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 17 Jan 2017 13:06:59 -0800 Subject: [PATCH] routing: fix nil pointer panic when node has no outgoing channels --- routing/pathfind.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing/pathfind.go b/routing/pathfind.go index 695477ef..a091f80a 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -295,7 +295,7 @@ func findRoute(graph *channeldb.ChannelGraph, target *btcec.PublicKey, // If we've reached our target, then we're done here and can // exit the graph traversal early. - if bestNode.PubKey.IsEqual(target) { + if bestNode == nil || bestNode.PubKey.IsEqual(target) { break }