From b9c33da3f8bdcff091c2d5e34a06ef31ca8d104b Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 10 Dec 2018 14:56:54 +0100 Subject: [PATCH] autopilot/prefattach: skip nodes having no channels --- autopilot/prefattach.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autopilot/prefattach.go b/autopilot/prefattach.go index 32bd2fcc5..656763072 100644 --- a/autopilot/prefattach.go +++ b/autopilot/prefattach.go @@ -166,6 +166,11 @@ func (p *ConstrainedPrefAttachment) NodeScores(g ChannelGraph, chans []Channel, // skip it for now, which implicitly gives it a score of 0. case len(addrs) == 0: continue + + // If the node had no channels, we skip it, since it would have + // gotten a zero score anyway. + case nodeChans == 0: + continue } // Otherwise we score the node according to its fraction of