mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
routing: avoid open DB transaction if no zombies to prune
We add a simple length check to the channels to be pruned to avoid opening the DB if there is nothing to be done.
This commit is contained in:
parent
a0f3624303
commit
1231c90a19
@ -897,6 +897,9 @@ func (r *ChannelRouter) pruneZombieChans() error {
|
||||
}
|
||||
|
||||
log.Infof("Pruning %v zombie channels", len(chansToPrune))
|
||||
if len(chansToPrune) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
// With the set of zombie-like channels obtained, we'll do another pass
|
||||
// to delete them from the channel graph.
|
||||
|
Loading…
Reference in New Issue
Block a user