From 8f06b7980dd2b6023ee7657d28da5567cdda4fcc Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Sun, 6 Aug 2017 08:54:25 +0300 Subject: eth: fix megacheck warnings --- eth/sync.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'eth/sync.go') diff --git a/eth/sync.go b/eth/sync.go index 8784b225d..7442f912c 100644 --- a/eth/sync.go +++ b/eth/sync.go @@ -138,7 +138,9 @@ func (pm *ProtocolManager) syncer() { defer pm.downloader.Terminate() // Wait for different events to fire synchronisation operations - forceSync := time.Tick(forceSyncCycle) + forceSync := time.NewTicker(forceSyncCycle) + defer forceSync.Stop() + for { select { case <-pm.newPeerCh: @@ -148,7 +150,7 @@ func (pm *ProtocolManager) syncer() { } go pm.synchronise(pm.peers.BestPeer()) - case <-forceSync: + case <-forceSync.C: // Force a sync even if not enough peers are present go pm.synchronise(pm.peers.BestPeer()) -- cgit v1.2.3