eth: move downloader.Cancel call into chainSyncer

This commit is contained in:
Felix Lange 2020-03-25 18:46:28 +01:00
parent c3d032d7a8
commit 15fd802037
2 changed files with 1 additions and 1 deletions

View file

@ -275,7 +275,6 @@ func (pm *ProtocolManager) Stop() {
// Quit chainSync and txsync64. // Quit chainSync and txsync64.
// After this is done, no new peers will be accepted. // After this is done, no new peers will be accepted.
close(pm.quitSync) close(pm.quitSync)
pm.downloader.Cancel()
pm.wg.Wait() pm.wg.Wait()
// Disconnect existing sessions. // Disconnect existing sessions.

View file

@ -220,6 +220,7 @@ func (cs *chainSyncer) loop() {
case <-cs.pm.quitSync: case <-cs.pm.quitSync:
if cs.doneCh != nil { if cs.doneCh != nil {
cs.pm.downloader.Cancel()
<-cs.doneCh <-cs.doneCh
} }
return return