aboutsummaryrefslogtreecommitdiffstats
path: root/ethminer
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-30 19:27:56 +0800
committerobscuren <geffobscura@gmail.com>2014-05-30 19:27:56 +0800
commite0b6a31613bc48bc5785f2bea655f832848392d8 (patch)
tree08a25a1b318dfd25742059208cf1783c67a1a971 /ethminer
parentf382221b28ab9e886263e37b1eab9c7924a6a0dc (diff)
downloaddexon-e0b6a31613bc48bc5785f2bea655f832848392d8.tar
dexon-e0b6a31613bc48bc5785f2bea655f832848392d8.tar.gz
dexon-e0b6a31613bc48bc5785f2bea655f832848392d8.tar.bz2
dexon-e0b6a31613bc48bc5785f2bea655f832848392d8.tar.lz
dexon-e0b6a31613bc48bc5785f2bea655f832848392d8.tar.xz
dexon-e0b6a31613bc48bc5785f2bea655f832848392d8.tar.zst
dexon-e0b6a31613bc48bc5785f2bea655f832848392d8.zip
Buffered channel to fix not ready (blocking)
Diffstat (limited to 'ethminer')
-rw-r--r--ethminer/miner.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/ethminer/miner.go b/ethminer/miner.go
index 9396d33f9..e7237bae2 100644
--- a/ethminer/miner.go
+++ b/ethminer/miner.go
@@ -25,6 +25,7 @@ func NewDefaultMiner(coinbase []byte, ethereum ethchain.EthManager) Miner {
reactChan := make(chan ethutil.React, 1) // This is the channel that receives 'updates' when ever a new transaction or block comes in
powChan := make(chan []byte, 1) // This is the channel that receives valid sha hases for a given block
powQuitChan := make(chan ethutil.React, 1) // This is the channel that can exit the miner thread
+ quitChan := make(chan bool, 1)
ethereum.Reactor().Subscribe("newBlock", reactChan)
ethereum.Reactor().Subscribe("newTx:pre", reactChan)
@@ -44,7 +45,7 @@ func NewDefaultMiner(coinbase []byte, ethereum ethchain.EthManager) Miner {
reactChan: reactChan,
powChan: powChan,
powQuitChan: powQuitChan,
- quitChan: make(chan bool),
+ quitChan: quitChan,
}
// Insert initial TXs in our little miner 'pool'