From e6d46f681b54d53b9cddab59bf77c6cac53b35e8 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 4 Jun 2018 17:18:48 -0700 Subject: [PATCH] discovery: if gossipSyncer is shutting down, don't filter messages --- discovery/syncer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/discovery/syncer.go b/discovery/syncer.go index a187c7ef..d115c723 100644 --- a/discovery/syncer.go +++ b/discovery/syncer.go @@ -805,6 +805,12 @@ func (g *gossipSyncer) FilterGossipMsgs(msgs ...msgWithSenders) { return } + // If we've been signalled to exit, or are exiting, then we'll stop + // short. + if atomic.LoadUint32(&g.stopped) == 1 { + return + } + // TODO(roasbeef): need to ensure that peer still online...send msg to // gossiper on peer termination to signal peer disconnect?