mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
eth: move downloader.Cancel call into chainSyncer
This commit is contained in:
parent
c3d032d7a8
commit
15fd802037
2 changed files with 1 additions and 1 deletions
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue