core, eth, event, miner, xeth: fix event post / subscription race

This commit is contained in:
Péter Szilágyi
2015-10-12 15:04:38 +03:00
parent 315a422ba7
commit 402fd6e8c6
11 changed files with 123 additions and 94 deletions

View File

@ -66,7 +66,7 @@ func (self *Miner) update() {
events := self.mux.Subscribe(downloader.StartEvent{}, downloader.DoneEvent{}, downloader.FailedEvent{})
out:
for ev := range events.Chan() {
switch ev.(type) {
switch ev.Data.(type) {
case downloader.StartEvent:
atomic.StoreInt32(&self.canStart, 0)
if self.Mining() {