diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-05-30 17:01:50 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-05-30 17:01:50 +0800 |
commit | 4496a44f68246bf128bb822c3f3a98f38adfdbdd (patch) | |
tree | 312922dbfc111fd3ef66c194dcdc6c87b96bba66 /eth/downloader/downloader.go | |
parent | ab664c7e17009729d1083d8d4f7c37eb387012d3 (diff) | |
download | dexon-4496a44f68246bf128bb822c3f3a98f38adfdbdd.tar dexon-4496a44f68246bf128bb822c3f3a98f38adfdbdd.tar.gz dexon-4496a44f68246bf128bb822c3f3a98f38adfdbdd.tar.bz2 dexon-4496a44f68246bf128bb822c3f3a98f38adfdbdd.tar.lz dexon-4496a44f68246bf128bb822c3f3a98f38adfdbdd.tar.xz dexon-4496a44f68246bf128bb822c3f3a98f38adfdbdd.tar.zst dexon-4496a44f68246bf128bb822c3f3a98f38adfdbdd.zip |
eth/downloader: ensure cancel channel is closed post sync
Diffstat (limited to 'eth/downloader/downloader.go')
-rw-r--r-- | eth/downloader/downloader.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 74bff2b66..f1a589fa6 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -332,6 +332,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 { |