From 3a465c64b5dcc16f3114fb00af03500604115143 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 21 Jul 2018 19:49:08 -0700 Subject: [PATCH] channeldb: modify pruneGraphNodes to prune nodes if no edges exist --- channeldb/graph.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/channeldb/graph.go b/channeldb/graph.go index 920193aa4..6ab7b35df 100644 --- a/channeldb/graph.go +++ b/channeldb/graph.go @@ -734,7 +734,11 @@ func (c *ChannelGraph) pruneGraphNodes(tx *bolt.Tx, nodes *bolt.Bucket, numChansLeft++ return nil }) - if err != nil { + + // If we're unable read the node, or no edges exist in the + // graph atm (so all the nodes are unconnected), then we'll + // just skip this node all together. + if err != nil && err != ErrGraphNoEdgesFound { continue }