good morning!!!!

Skip to content
Snippets Groups Projects
Commit e3f2b541 authored by Péter Szilágyi's avatar Péter Szilágyi
Browse files

eth/downloader: fix a throughput estimation data race

parent edd7aa05
No related branches found
No related tags found
No related merge requests found
......@@ -251,8 +251,8 @@ func (p *peer) setIdle(started time.Time, delivered int, throughput *float64, id
// Irrelevant of the scaling, make sure the peer ends up idle
defer atomic.StoreInt32(idle, 0)
p.lock.RLock()
defer p.lock.RUnlock()
p.lock.Lock()
defer p.lock.Unlock()
// If nothing was delivered (hard timeout / unavailable data), reduce throughput to minimum
if delivered == 0 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment