routing: add strict zombie pruning as a config level param

In this commit, we add strict zombie pruning as a config level param.
This allow us to add the option for those that want a tighter graph, and
not change the default composition of the channel graph for most users
over night.

In addition, we expand the test case slightly by testing that the self
node won't be pruned, but also that if there's a node with only a single
known stale edge, then both variants will prune that edge.
This commit is contained in:
Olaoluwa Osuntokun
2021-04-02 14:57:50 -07:00
parent 916059da48
commit 7b589e5811
5 changed files with 134 additions and 77 deletions

View File

@ -2344,7 +2344,7 @@ func abandonChanFromGraph(chanGraph *channeldb.ChannelGraph,
// If the channel ID is still in the graph, then that means the channel
// is still open, so we'll now move to purge it from the graph.
return chanGraph.DeleteChannelEdges(chanID)
return chanGraph.DeleteChannelEdges(false, chanID)
}
// AbandonChannel removes all channel state from the database except for a