mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-09 01:32:09 +02:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user