diff --git a/eth/fetcher/fetcher.go b/eth/fetcher/fetcher.go index 277f14b81a..58ff43d83c 100644 --- a/eth/fetcher/fetcher.go +++ b/eth/fetcher/fetcher.go @@ -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)