channeldb: modify pruneGraphNodes to prune nodes if no edges exist

This commit is contained in:
Olaoluwa Osuntokun 2018-07-21 19:49:08 -07:00
parent bca926d6af
commit 3a465c64b5
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

View File

@ -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
}