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

This commit is contained in:
Olaoluwa Osuntokun 2017-01-17 13:06:59 -08:00
parent 7a36fb4562
commit 0c7fcb1755
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

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
}