aboutsummaryrefslogtreecommitdiffstats
path: root/ethminer/miner.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-07-22 02:12:04 +0800
committerzelig <viktor.tron@gmail.com>2014-07-22 02:12:04 +0800
commit194c58858cd230a9a08b0eb14650720341a5580e (patch)
tree436dfde4f7d928be0fbc0267b4059cde39bac72e /ethminer/miner.go
parent67528cf9709519458ab5500cb7cf54664dd20167 (diff)
downloaddexon-194c58858cd230a9a08b0eb14650720341a5580e.tar
dexon-194c58858cd230a9a08b0eb14650720341a5580e.tar.gz
dexon-194c58858cd230a9a08b0eb14650720341a5580e.tar.bz2
dexon-194c58858cd230a9a08b0eb14650720341a5580e.tar.lz
dexon-194c58858cd230a9a08b0eb14650720341a5580e.tar.xz
dexon-194c58858cd230a9a08b0eb14650720341a5580e.tar.zst
dexon-194c58858cd230a9a08b0eb14650720341a5580e.zip
send zero event to miner.powQuitChan fixes miner hanging
Diffstat (limited to 'ethminer/miner.go')
-rw-r--r--ethminer/miner.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/ethminer/miner.go b/ethminer/miner.go
index 8659d2889..e51b37e05 100644
--- a/ethminer/miner.go
+++ b/ethminer/miner.go
@@ -133,6 +133,9 @@ func (miner *Miner) listener() {
func (miner *Miner) Stop() {
logger.Infoln("Stopping...")
+
+ miner.powQuitChan <- ethreact.Event{}
+
status := make(chan error)
miner.quitChan <- status
<-status
@@ -143,9 +146,6 @@ func (miner *Miner) Stop() {
reactor.Unsubscribe("newBlock", miner.reactChan)
reactor.Unsubscribe("newTx:pre", miner.reactChan)
- close(miner.powQuitChan)
- close(miner.quitChan)
-
reactor.Post("miner:stop", miner)
}