Skip to content

Commit 7cee250

Browse files
committed
eth/downloader: allow all timers to exit
1 parent 8f24097 commit 7cee250

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

eth/downloader/statesync.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,7 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
197197
}
198198
// Start a timer to notify the sync loop if the peer stalled.
199199
req.timer = time.AfterFunc(req.timeout, func() {
200-
select {
201-
case timeout <- req:
202-
case <-s.done:
203-
// Prevent leaking of timer goroutines in the unlikely case where a
204-
// timer is fired just before exiting runStateSync.
205-
}
200+
timeout <- req
206201
})
207202
active[req.peer.id] = req
208203
}
@@ -214,7 +209,6 @@ func (d *Downloader) runStateSync(s *stateSync) *stateSync {
214209
// are marked as idle and de facto _are_ idle.
215210
func (d *Downloader) spindownStateSync(active map[string]*stateReq, finished []*stateReq, timeout chan *stateReq, peerDrop chan *peerConnection) {
216211
log.Trace("State sync spinning down", "active", len(active), "finished", len(finished))
217-
218212
for len(active) > 0 {
219213
var (
220214
req *stateReq

0 commit comments

Comments
 (0)