浏览代码

fix ungraceful shutdown issue

fudongbai 4 年之前
父节点
当前提交
571a317092
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      eth/backend.go

+ 3 - 0
eth/backend.go

@@ -574,6 +574,9 @@ func (s *Ethereum) Stop() error {
 	close(s.closeBloomHandler)
 	s.txPool.Stop()
 	s.miner.Stop()
+	s.miner.Close()
+	// TODO this is a hotfix for https://github.com/ethereum/go-ethereum/issues/22892, need a better solution
+	time.Sleep(5 * time.Second)
 	s.blockchain.Stop()
 	s.engine.Close()
 	rawdb.PopUncleanShutdownMarker(s.chainDb)