mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-06 11:25:02 +00:00
Buffered channel to fix not ready (blocking)
This commit is contained in:
parent
f382221b28
commit
e0b6a31613
1 changed files with 2 additions and 1 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Reference in a new issue