From 7e7b8a19408655febea8598d1eda0df780e55a2f Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Wed, 17 Apr 2019 13:24:49 -0700 Subject: [PATCH] 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. --- routing/router.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/routing/router.go b/routing/router.go index b6c70e1a..efa27073 100644 --- a/routing/router.go +++ b/routing/router.go @@ -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 }