miner: fix megacheck warnings

This commit is contained in:
Egon Elbre
2017-08-06 19:40:34 +03:00
parent b159cdd8dd
commit faafeef79e
2 changed files with 5 additions and 13 deletions

View File

@ -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 {