aboutsummaryrefslogtreecommitdiffstats
path: root/miner/remote_agent.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-07 19:31:41 +0800
committerGitHub <noreply@github.com>2017-08-07 19:31:41 +0800
commit8c2cf3c66cf1d678b8b22e2c6245976058bfb525 (patch)
tree1cb4b88f9a4199bd84a3ee37889138946d14ccd7 /miner/remote_agent.go
parent37e9fcaccaff4c7eda4848f8bd3f9ac5b42daa30 (diff)
parentfaafeef79e1a7af462c5031a91936aae0c9cebf2 (diff)
downloadgo-tangerine-8c2cf3c66cf1d678b8b22e2c6245976058bfb525.tar
go-tangerine-8c2cf3c66cf1d678b8b22e2c6245976058bfb525.tar.gz
go-tangerine-8c2cf3c66cf1d678b8b22e2c6245976058bfb525.tar.bz2
go-tangerine-8c2cf3c66cf1d678b8b22e2c6245976058bfb525.tar.lz
go-tangerine-8c2cf3c66cf1d678b8b22e2c6245976058bfb525.tar.xz
go-tangerine-8c2cf3c66cf1d678b8b22e2c6245976058bfb525.tar.zst
go-tangerine-8c2cf3c66cf1d678b8b22e2c6245976058bfb525.zip
Merge pull request #14922 from egonelbre/megacheck_miner
miner: fix megacheck warnings
Diffstat (limited to 'miner/remote_agent.go')
-rw-r--r--miner/remote_agent.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/miner/remote_agent.go b/miner/remote_agent.go
index bb223ba1b..aac7ce865 100644
--- a/miner/remote_agent.go
+++ b/miner/remote_agent.go
@@ -169,7 +169,8 @@ func (a *RemoteAgent) SubmitWork(nonce types.BlockNonce, mixDigest, hash common.
// RemoteAgent.Start() constantly recreates these channels, so the loop code cannot
// assume data stability in these member fields.
func (a *RemoteAgent) loop(workCh chan *Work, quitCh chan struct{}) {
- ticker := time.Tick(5 * time.Second)
+ ticker := time.NewTicker(5 * time.Second)
+ defer ticker.Stop()
for {
select {
@@ -179,7 +180,7 @@ func (a *RemoteAgent) loop(workCh chan *Work, quitCh chan struct{}) {
a.mu.Lock()
a.currentWork = work
a.mu.Unlock()
- case <-ticker:
+ case <-ticker.C:
// cleanup
a.mu.Lock()
for hash, work := range a.work {