mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-26 04:42:35 +02: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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user