mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-02 09:33:46 +00:00
eth/fetcher: avoid spurious timer events at startup (#22652)
Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
parent
72e37942f3
commit
a50251e6cb
1 changed files with 6 additions and 2 deletions
|
|
@ -331,8 +331,12 @@ func (f *BlockFetcher) FilterBodies(peer string, transactions [][]*types.Transac
|
|||
// events.
|
||||
func (f *BlockFetcher) loop() {
|
||||
// Iterate the block fetching until a quit is requested
|
||||
fetchTimer := time.NewTimer(0)
|
||||
completeTimer := time.NewTimer(0)
|
||||
var (
|
||||
fetchTimer = time.NewTimer(0)
|
||||
completeTimer = time.NewTimer(0)
|
||||
)
|
||||
<-fetchTimer.C // clear out the channel
|
||||
<-completeTimer.C
|
||||
defer fetchTimer.Stop()
|
||||
defer completeTimer.Stop()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue