mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-11 12:42:47 +02:00
routing: implement 2-week zombie channel pruning
This commit implements 2-week zombie channel pruning. This means that every GraphPruneInterval (currently set to one hour), we’ll scan the channel graph, marking any channels which haven’t had *both* edges updated in 2 weeks as a “zombie”. During the second pass, all “zombie” channel are removed from the channel graph all together. Adding this functionality means we’ll ensure that we maintain a “healthy” network view, which will cut down on the number of failed HTLC routing attempts, and also reflect an active portion of the graph.
This commit is contained in:
@@ -266,6 +266,8 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
|
||||
|
||||
return s.htlcSwitch.SendHTLC(firstHopPub, htlcAdd, errorDecryptor)
|
||||
},
|
||||
ChannelPruneExpiry: time.Duration(time.Hour * 24 * 14),
|
||||
GraphPruneInterval: time.Duration(time.Hour),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't create router: %v", err)
|
||||
|
Reference in New Issue
Block a user