good morning!!!!

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

eth/downloader: fix cancel channel double close

parent 7d71a75d
No related branches found
No related tags found
No related merge requests found
......@@ -212,9 +212,14 @@ func (d *Downloader) Cancel() bool {
return false
}
// Close the current cancel channel
d.cancelLock.RLock()
close(d.cancelCh)
d.cancelLock.RUnlock()
d.cancelLock.Lock()
select {
case <-d.cancelCh:
// Channel was already closed
default:
close(d.cancelCh)
}
d.cancelLock.Unlock()
// reset the queue
d.queue.Reset()
......
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