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
@ -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…
Reference in New Issue
Block a user