aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-05 07:05:47 +0800
committerobscuren <geffobscura@gmail.com>2015-02-05 07:05:47 +0800
commit65158d39b0632226c168b9a3415365ca8f072cbf (patch)
tree9b8bb62fa6b2a056a85a889f7f8609aca0a6f875 /miner
parentb1870631a4829e075eae77064973ef94aa2166b3 (diff)
downloadgo-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.go13
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