aboutsummaryrefslogtreecommitdiffstats
path: root/eth/sync.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-08 14:59:52 +0800
committerGitHub <noreply@github.com>2017-08-08 14:59:52 +0800
commit43437806fb49d4ca0b5f6e7599c9871663960b15 (patch)
tree8b67d622446f9ae874df555e41a5709c99ce3431 /eth/sync.go
parent971079822ee6c12d9348ec78f212fe91c9b83edf (diff)
parent8f06b7980dd2b6023ee7657d28da5567cdda4fcc (diff)
downloaddexon-43437806fb49d4ca0b5f6e7599c9871663960b15.tar
dexon-43437806fb49d4ca0b5f6e7599c9871663960b15.tar.gz
dexon-43437806fb49d4ca0b5f6e7599c9871663960b15.tar.bz2
dexon-43437806fb49d4ca0b5f6e7599c9871663960b15.tar.lz
dexon-43437806fb49d4ca0b5f6e7599c9871663960b15.tar.xz
dexon-43437806fb49d4ca0b5f6e7599c9871663960b15.tar.zst
dexon-43437806fb49d4ca0b5f6e7599c9871663960b15.zip
Merge pull request #14933 from egonelbre/megacheck_eth
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())