This commit is contained in:
etying 2018-08-29 02:44:41 +00:00 committed by GitHub
commit 8dc838b05c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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