routing: fix nil pointer panic when node has no outgoing channels

This commit is contained in:
Olaoluwa Osuntokun committed 2017-01-17 13:07:05 -08:00
1 parent 7a36fb4562
commit 0c7fcb1755
1 file changed
+1 -1
+1 -1
View File
@@ -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
}