mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-11 13:03:21 +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:
@@ -84,6 +84,8 @@ func createTestCtx(startingHeight uint32, testGraph ...string) (*testCtx, func()
|
||||
_ *lnwire.UpdateAddHTLC, _ *sphinx.Circuit) ([32]byte, error) {
|
||||
return [32]byte{}, nil
|
||||
},
|
||||
ChannelPruneExpiry: time.Hour * 24,
|
||||
GraphPruneInterval: time.Hour * 2,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("unable to create router %v", err)
|
||||
|
Reference in New Issue
Block a user