aboutsummaryrefslogtreecommitdiffstats
path: root/eth/sync.go
diff options
context:
space:
mode:
authorEgon Elbre <egonelbre@gmail.com>2017-08-06 13:54:25 +0800
committerEgon Elbre <egonelbre@gmail.com>2017-08-08 00:54:20 +0800
commit8f06b7980dd2b6023ee7657d28da5567cdda4fcc (patch)
tree8b67d622446f9ae874df555e41a5709c99ce3431 /eth/sync.go
parent971079822ee6c12d9348ec78f212fe91c9b83edf (diff)
downloadgo-tangerine-8f06b7980dd2b6023ee7657d28da5567cdda4fcc.tar
go-tangerine-8f06b7980dd2b6023ee7657d28da5567cdda4fcc.tar.gz
go-tangerine-8f06b7980dd2b6023ee7657d28da5567cdda4fcc.tar.bz2
go-tangerine-8f06b7980dd2b6023ee7657d28da5567cdda4fcc.tar.lz
go-tangerine-8f06b7980dd2b6023ee7657d28da5567cdda4fcc.tar.xz
go-tangerine-8f06b7980dd2b6023ee7657d28da5567cdda4fcc.tar.zst
go-tangerine-8f06b7980dd2b6023ee7657d28da5567cdda4fcc.zip
eth: fix megacheck warnings
Diffstat (limited to 'eth/sync.go')
-rw-r--r--eth/sync.go6
1 files changed, 4 insertions, 2 deletions
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())