router+graph: return ErrGraphNodesNotFound if no nodes to prune

Avoids creating a bucket unneccessarily.
This commit is contained in:
Johan T. Halseth
2018-12-04 11:20:38 +01:00
parent 87df6b71c5
commit 81fe6e73ed
2 changed files with 5 additions and 4 deletions

View File

@@ -445,7 +445,8 @@ func (r *ChannelRouter) Start() error {
// Finally, before we proceed, we'll prune any unconnected nodes from
// the graph in order to ensure we maintain a tight graph of "useful"
// nodes.
if err := r.cfg.Graph.PruneGraphNodes(); err != nil {
err = r.cfg.Graph.PruneGraphNodes()
if err != nil && err != channeldb.ErrGraphNodesNotFound {
return err
}