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:
Olaoluwa Osuntokun 2017-11-15 18:17:43 -08:00
parent 7408aa6c8d
commit 2b052cc889
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -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