diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-05 07:05:47 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-05 07:05:47 +0800 |
commit | 65158d39b0632226c168b9a3415365ca8f072cbf (patch) | |
tree | 9b8bb62fa6b2a056a85a889f7f8609aca0a6f875 /miner | |
parent | b1870631a4829e075eae77064973ef94aa2166b3 (diff) | |
download | go-tangerine-65158d39b0632226c168b9a3415365ca8f072cbf.tar go-tangerine-65158d39b0632226c168b9a3415365ca8f072cbf.tar.gz go-tangerine-65158d39b0632226c168b9a3415365ca8f072cbf.tar.bz2 go-tangerine-65158d39b0632226c168b9a3415365ca8f072cbf.tar.lz go-tangerine-65158d39b0632226c168b9a3415365ca8f072cbf.tar.xz go-tangerine-65158d39b0632226c168b9a3415365ca8f072cbf.tar.zst go-tangerine-65158d39b0632226c168b9a3415365ca8f072cbf.zip |
Filtering
Diffstat (limited to 'miner')
-rw-r--r-- | miner/worker.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/miner/worker.go b/miner/worker.go index dbb8a5832..ea8f2e8b5 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -41,6 +41,10 @@ func env(block *types.Block, eth *eth.Ethereum) *environment { return env } +type Agent interface { + Comms() chan<- *types.Block +} + type worker struct { agents []chan<- *types.Block mux *event.TypeMux @@ -68,11 +72,12 @@ out: case event := <-events.Chan(): switch event := event.(type) { case core.NewBlockEvent: - block := event.Block - if self.eth.ChainManager().HasBlock(block.Hash()) { - } else if true { + if self.eth.ChainManager().HasBlock(event.Block.Hash()) { + } + case core.TxPreEvent: + if err := self.commitTransaction(event.Tx); err != nil { + self.commit() } - case core.TxPreEvent, *LocalTx: } case <-self.quit: break out |