aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/downloader.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-05-31 19:48:52 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-05-31 19:48:52 +0800
commit16a23ff74056aa306eb8a87272277bc8660f3252 (patch)
tree811c5baa8451f5a13e16c7fe033a20e67df12629 /eth/downloader/downloader.go
parent1d5d21726a49a1dcf06d0d1544e1bd93f4231632 (diff)
parent4496a44f68246bf128bb822c3f3a98f38adfdbdd (diff)
downloaddexon-16a23ff74056aa306eb8a87272277bc8660f3252.tar
dexon-16a23ff74056aa306eb8a87272277bc8660f3252.tar.gz
dexon-16a23ff74056aa306eb8a87272277bc8660f3252.tar.bz2
dexon-16a23ff74056aa306eb8a87272277bc8660f3252.tar.lz
dexon-16a23ff74056aa306eb8a87272277bc8660f3252.tar.xz
dexon-16a23ff74056aa306eb8a87272277bc8660f3252.tar.zst
dexon-16a23ff74056aa306eb8a87272277bc8660f3252.zip
Merge pull request #2637 from karalabe/downloader-always-cancel
eth/downloader: ensure cancel channel is closed post sync
Diffstat (limited to 'eth/downloader/downloader.go')
-rw-r--r--eth/downloader/downloader.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go
index 8cb0d21f7..f6dbb4610 100644
--- a/eth/downloader/downloader.go
+++ b/eth/downloader/downloader.go
@@ -326,6 +326,8 @@ func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode
d.cancelCh = make(chan struct{})
d.cancelLock.Unlock()
+ defer d.cancel() // No matter what, we can't leave the cancel channel open
+
// Set the requested sync mode, unless it's forbidden
d.mode = mode
if d.mode == FastSync && d.noFast {