From 2b052cc8894f765c1b4c2c474b3ceac6f25870b0 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 15 Nov 2017 18:17:43 -0800 Subject: [PATCH] routing: only update the filter if we have a non-zero chain view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- routing/router.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/routing/router.go b/routing/router.go index 04feda2e..46f5bd5c 100644 --- a/routing/router.go +++ b/routing/router.go @@ -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