diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index a9ba3156c3..39be90216a 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -375,10 +375,11 @@ func (q *queue) Results(block bool) []*fetchResult { results := q.resultCache.GetCompleted(maxResultsProcess) + var throttleThreshold uint64 if len(results) > 0 { // set a throttle threshhold based on estimated worst-sized block that can be created for a given gas limit. gasLimit := max(results[0].Header.GasLimit, 10) - throttleThreshold := min(uint64(blockCacheMemory)/(gasLimit/10), 2048) + throttleThreshold = min(uint64(blockCacheMemory)/(gasLimit/10), 2048) throttleThreshold = q.resultCache.SetThrottleThreshold(throttleThreshold) }