routing: fix nil pointer panic when node has no outgoing channels
This commit is contained in:
1 file changed
+1
-1
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user