aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
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/worker.go
parentb1870631a4829e075eae77064973ef94aa2166b3 (diff)
downloaddexon-65158d39b0632226c168b9a3415365ca8f072cbf.tar.gz
dexon-65158d39b0632226c168b9a3415365ca8f072cbf.tar.zst
dexon-65158d39b0632226c168b9a3415365ca8f072cbf.zip
Filtering
Diffstat (limited to 'miner/worker.go')
-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