From 4496a44f68246bf128bb822c3f3a98f38adfdbdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Mon, 30 May 2016 12:01:50 +0300 Subject: eth/downloader: ensure cancel channel is closed post sync --- eth/downloader/downloader.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'eth/downloader/downloader.go') 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 { -- cgit v1.2.3