Explorar o código

fix ungraceful shutdown issue

fudongbai %!s(int64=4) %!d(string=hai) anos
pai
achega
571a317092
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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)