mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
routing: only update the filter if we have a non-zero chain view
In this commit we ensure that we only update the filter, if we have a non-zero chain view. Otherwise, a mini rescan may be kicked off unnecessarily if we don’t yet know of any channels yet in the greater graph.
This commit is contained in:
parent
7408aa6c8d
commit
2b052cc889
1 changed files with 5 additions and 3 deletions
|
@ -295,9 +295,11 @@ func (r *ChannelRouter) Start() error {
|
|||
}
|
||||
|
||||
log.Infof("Filtering chain using %v channels active", len(channelView))
|
||||
err = r.cfg.ChainView.UpdateFilter(channelView, pruneHeight)
|
||||
if err != nil {
|
||||
return err
|
||||
if len(channelView) != 0 {
|
||||
err = r.cfg.ChainView.UpdateFilter(channelView, pruneHeight)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Before we begin normal operation of the router, we first need to
|
||||
|
|
Loading…
Add table
Reference in a new issue