[release/1.4.6] eth/downloader: ensure cancel channel is closed post sync

(cherry picked from commit 4496a44f68)
This commit is contained in:
Péter Szilágyi
2016-05-30 12:01:50 +03:00
parent 4918c820c6
commit cd134178f7
2 changed files with 13 additions and 1 deletions

View File

@@ -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 {