From e252dbf989f8a8e08e3edcaf075febee315e53fd Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 29 Oct 2014 03:01:20 +0100 Subject: [PATCH] eth: stop eventMux first This fixes the hang in Ethereum.Stop. --- ethereum.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ethereum.go b/ethereum.go index c2d2095977..a389c663d5 100644 --- a/ethereum.go +++ b/ethereum.go @@ -490,6 +490,9 @@ func (s *Ethereum) peerHandler(listener net.Listener) { } func (s *Ethereum) Stop() { + // Stop eventMux first, it will close all subscriptions. + s.eventMux.Stop() + // Close the database defer s.db.Close() @@ -514,7 +517,6 @@ func (s *Ethereum) Stop() { } s.txPool.Stop() s.stateManager.Stop() - s.eventMux.Stop() s.blockPool.Stop() ethlogger.Infoln("Server stopped")