We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99ca4b6 commit 3ce17d2Copy full SHA for 3ce17d2
eth/fetcher/fetcher.go
@@ -281,12 +281,13 @@ func (f *Fetcher) loop() {
281
282
glog.V(logger.Detail).Infof("Peer %s: fetching %s", peer, list)
283
}
284
- hashes := hashes // closure!
+ // Create a closure of the fetch and schedule in on a new thread
285
+ fetcher, hashes := f.fetching[hashes[0]].fetch, hashes
286
go func() {
287
if f.fetchingHook != nil {
288
f.fetchingHook(hashes)
289
- f.fetching[hashes[0]].fetch(hashes)
290
+ fetcher(hashes)
291
}()
292
293
// Schedule the next fetch if blocks are still pending
0 commit comments