Update reactor.go (#5088)

check bcR.fastSync flag when "OnStop"

fix "service/service.go:161	Not stopping BlockPool -- have not been started yet	{"impl": "BlockPool"}" error when kill process
This commit is contained in:
Lei Wang
2020-07-07 09:47:49 +00:00
committed by GitHub
parent be12bb5bb7
commit 430162f8a1
+3 -1
View File
@@ -128,7 +128,9 @@ func (bcR *BlockchainReactor) SwitchToFastSync(state sm.State) error {
// OnStop implements service.Service.
func (bcR *BlockchainReactor) OnStop() {
bcR.pool.Stop()
if bcR.fastSync {
bcR.pool.Stop()
}
}
// GetChannels implements Reactor