Skip to content

Commit e252dbf

Browse files
committed
eth: stop eventMux first
This fixes the hang in Ethereum.Stop.
1 parent 8170f96 commit e252dbf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎ethereum.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,9 @@ func (s *Ethereum) peerHandler(listener net.Listener) {
490490
}
491491

492492
func (s *Ethereum) Stop() {
493+
// Stop eventMux first, it will close all subscriptions.
494+
s.eventMux.Stop()
495+
493496
// Close the database
494497
defer s.db.Close()
495498

@@ -514,7 +517,6 @@ func (s *Ethereum) Stop() {
514517
}
515518
s.txPool.Stop()
516519
s.stateManager.Stop()
517-
s.eventMux.Stop()
518520
s.blockPool.Stop()
519521

520522
ethlogger.Infoln("Server stopped")

0 commit comments

Comments
 (0)