Commit b3516555 authored by Wenbiao Zheng's avatar Wenbiao Zheng Committed by Péter Szilágyi

eth/downloader: remove the expired id directly (#17963)

parent 5b74bb64
...@@ -664,12 +664,11 @@ func (q *queue) expire(timeout time.Duration, pendPool map[string]*fetchRequest, ...@@ -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
delete(pendPool, id)
} }
} }
// Remove the expired requests from the pending pool
for id := range expiries {
delete(pendPool, id)
}
return expiries return expiries
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment