routing: add strict pruning as new flag, default for neutrino

In this commit we add a new flag that controls if lnd will do strict
zombie pruning or not. If true, then this will cause lnd to maintain a
tighter graph as it wants both edges to always be live. We enable this by
default for neutrino as without this, it's possible that a node never
sees both edges begin disabled, so those edges are never actually pruned
from the graph.
This commit is contained in:
Olaoluwa Osuntokun
2021-04-02 15:02:08 -07:00
parent 7b589e5811
commit 6c27de7d11
3 changed files with 12 additions and 1 deletions

View File

@@ -768,6 +768,8 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
s.controlTower = routing.NewControlTower(paymentControl)
strictPruning := (cfg.Bitcoin.Node == "neutrino" ||
cfg.Routing.StrictZombiePruning)
s.chanRouter, err = routing.New(routing.Config{
Graph: chanGraph,
Chain: cc.ChainIO,
@@ -784,6 +786,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
NextPaymentID: sequencer.NextID,
PathFindingConfig: pathFindingConfig,
Clock: clock.NewDefaultClock(),
StrictZombiePruning: strictPruning,
})
if err != nil {
return nil, fmt.Errorf("can't create router: %v", err)