diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-06 22:50:44 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-06 22:50:44 +0800 |
commit | 8d9be18b296afb8302249dcc96651aabb0975e26 (patch) | |
tree | 70b8e2ac38edcb8968b946bcfc0772f188d668d7 /miner/worker.go | |
parent | b72ca57775c7baa6d83cf00093496c9836039d47 (diff) | |
download | dexon-8d9be18b296afb8302249dcc96651aabb0975e26.tar.gz dexon-8d9be18b296afb8302249dcc96651aabb0975e26.tar.zst dexon-8d9be18b296afb8302249dcc96651aabb0975e26.zip |
Queued approach to delivering chain events
Diffstat (limited to 'miner/worker.go')
-rw-r--r-- | miner/worker.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/miner/worker.go b/miner/worker.go index 29992b327..cd105fa73 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -116,7 +116,7 @@ func (self *worker) register(agent Agent) { } func (self *worker) update() { - events := self.mux.Subscribe(core.ChainEvent{}, core.NewMinedBlockEvent{}) + events := self.mux.Subscribe(core.ChainHeadEvent{}, core.NewMinedBlockEvent{}) timer := time.NewTicker(2 * time.Second) @@ -125,7 +125,7 @@ out: select { case event := <-events.Chan(): switch ev := event.(type) { - case core.ChainEvent: + case core.ChainHeadEvent: if self.current.block != ev.Block { self.commitNewWork() } |