good morning!!!!

Skip to content
Snippets Groups Projects
Commit 164ba56a authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

Merge pull request #994 from karalabe/fix-cancel-double-close

eth/downloader: fix cancel channel double close
parents 7d71a75d 4f0d88cb
Branches
Tags
No related merge requests found
...@@ -212,9 +212,14 @@ func (d *Downloader) Cancel() bool { ...@@ -212,9 +212,14 @@ func (d *Downloader) Cancel() bool {
return false return false
} }
// Close the current cancel channel // Close the current cancel channel
d.cancelLock.RLock() d.cancelLock.Lock()
select {
case <-d.cancelCh:
// Channel was already closed
default:
close(d.cancelCh) close(d.cancelCh)
d.cancelLock.RUnlock() }
d.cancelLock.Unlock()
// reset the queue // reset the queue
d.queue.Reset() d.queue.Reset()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment