routing: prune graph nodes after pruning zombie channels

We do this to ensure we don't leave any stray nodes in our graph that
were part of the zombie channels that we've pruned.
This commit is contained in:
Wilmer Paulino
2019-04-17 13:24:49 -07:00
parent 7eb720e535
commit 7e7b8a1940

View File

@@ -727,6 +727,13 @@ func (r *ChannelRouter) pruneZombieChans() error {
}
}
// With the channels pruned, we'll also attempt to prune any nodes that
// were a part of them.
err = r.cfg.Graph.PruneGraphNodes()
if err != nil && err != channeldb.ErrGraphNodesNotFound {
return fmt.Errorf("unable to prune graph nodes: %v", err)
}
return nil
}