routing: prune channels only if both edges are present

We do this to ensure we don't prune too aggressively, as it's possible
that we've only received the channel announcement for a channel, but not
its accompanying channel updates.
This commit is contained in:
Wilmer Paulino
2019-04-17 13:22:33 -07:00
parent 29664c9704
commit 78bdcbb115
3 changed files with 150 additions and 3 deletions

View File

@@ -638,7 +638,7 @@ func (r *ChannelRouter) pruneZombieChans() error {
// If *both* edges haven't been updated for a period of
// chanExpiry, then we'll mark the channel itself as eligible
// for graph pruning.
e1Zombie, e2Zombie := true, true
var e1Zombie, e2Zombie bool
if e1 != nil {
e1Zombie = time.Since(e1.LastUpdate) >= chanExpiry
if e1Zombie {