eth/downloader: remove the expired id directly

This commit is contained in:
Delweng Zheng 2018-10-23 10:18:12 +08:00
parent 3088c122d8
commit e3a1eda53f

View file

@ -664,12 +664,11 @@ func (q *queue) expire(timeout time.Duration, pendPool map[string]*fetchRequest,
} }
// Add the peer to the expiry report along the number of failed requests // Add the peer to the expiry report along the number of failed requests
expiries[id] = len(request.Headers) expiries[id] = len(request.Headers)
}
} // Remove the expired requests from the pending pool directly
// Remove the expired requests from the pending pool
for id := range expiries {
delete(pendPool, id) delete(pendPool, id)
} }
}
return expiries return expiries
} }