From 72fbd1283b4db7acc6fafb622772c5b54b6732e4 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 29 Jan 2021 00:13:05 -0800 Subject: [PATCH] discovery/sync_manager: break out IsGraphSynced check --- discovery/sync_manager.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/discovery/sync_manager.go b/discovery/sync_manager.go index a0e73b066..62137fa06 100644 --- a/discovery/sync_manager.go +++ b/discovery/sync_manager.go @@ -380,12 +380,16 @@ func (m *SyncManager) syncerHandler() { // Our HistoricalSyncTicker has ticked, so we'll randomly select // a peer and force a historical sync with them. case <-m.cfg.HistoricalSyncTicker.Ticks(): + // If we don't have a syncer available we have nothing + // to do. s := m.forceHistoricalSync() + if s == nil { + continue + } - // If we don't have a syncer available or we've already - // performed our initial historical sync, then we have - // nothing left to do. - if s == nil || m.IsGraphSynced() { + // If we've already completed a historical sync, we'll + // skip setting the initial historical syncer. + if m.IsGraphSynced() { continue }