mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-09 20:33:45 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user