This commit is contained in:
etying 2018-08-28 19:43:22 -07:00
parent c1c003e4ff
commit de75f4296c

View file

@ -385,7 +385,7 @@ func (f *Fetcher) loop() {
// Create a closure of the fetch and schedule in on a new thread
fetchHeader, hashes := f.fetching[hashes[0]].fetchHeader, hashes
go func() {
go func(fetchHeader headerRequesterFn, hashes []common.Hash) {
if f.fetchingHook != nil {
f.fetchingHook(hashes)
}
@ -393,7 +393,7 @@ func (f *Fetcher) loop() {
headerFetchMeter.Mark(1)
fetchHeader(hash) // Suboptimal, but protocol doesn't allow batch header retrievals
}
}()
}(fetchHeader, hashes)
}
// Schedule the next fetch if blocks are still pending
f.rescheduleFetch(fetchTimer)