mirror of https://github.com/status-im/op-geth.git
eth,core: changed NewTicker to Tick
This commit is contained in:
parent
b298928c49
commit
c6ad3aec05
|
@ -669,7 +669,7 @@ func (self *ChainManager) merge(oldBlock, newBlock *types.Block) {
|
||||||
|
|
||||||
func (self *ChainManager) update() {
|
func (self *ChainManager) update() {
|
||||||
events := self.eventMux.Subscribe(queueEvent{})
|
events := self.eventMux.Subscribe(queueEvent{})
|
||||||
futureTimer := time.NewTicker(5 * time.Second)
|
futureTimer := time.Tick(5 * time.Second)
|
||||||
out:
|
out:
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
@ -696,7 +696,7 @@ out:
|
||||||
self.eventMux.Post(event)
|
self.eventMux.Post(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case <-futureTimer.C:
|
case <-futureTimer:
|
||||||
self.procFutureBlocks()
|
self.procFutureBlocks()
|
||||||
case <-self.quit:
|
case <-self.quit:
|
||||||
break out
|
break out
|
||||||
|
|
|
@ -15,8 +15,8 @@ func (pm *ProtocolManager) update() {
|
||||||
// itimer is used to determine when to start ignoring `minDesiredPeerCount`
|
// itimer is used to determine when to start ignoring `minDesiredPeerCount`
|
||||||
itimer := time.NewTimer(peerCountTimeout)
|
itimer := time.NewTimer(peerCountTimeout)
|
||||||
// btimer is used for picking of blocks from the downloader
|
// btimer is used for picking of blocks from the downloader
|
||||||
btimer := time.NewTicker(blockProcTimer)
|
btimer := time.Tick(blockProcTimer)
|
||||||
out:
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-pm.newPeerCh:
|
case <-pm.newPeerCh:
|
||||||
|
@ -43,10 +43,10 @@ out:
|
||||||
} else {
|
} else {
|
||||||
itimer.Reset(5 * time.Second)
|
itimer.Reset(5 * time.Second)
|
||||||
}
|
}
|
||||||
case <-btimer.C:
|
case <-btimer:
|
||||||
go pm.processBlocks()
|
go pm.processBlocks()
|
||||||
case <-pm.quitSync:
|
case <-pm.quitSync:
|
||||||
break out
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue