diff options
Diffstat (limited to 'ethchain/state_manager.go')
-rw-r--r-- | ethchain/state_manager.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ethchain/state_manager.go b/ethchain/state_manager.go index f38666572..93fd1ec58 100644 --- a/ethchain/state_manager.go +++ b/ethchain/state_manager.go @@ -104,18 +104,21 @@ func (self *StateManager) Stop() { } func (self *StateManager) updateThread() { - blockChan := self.eth.Eventer().Register("block") + blockChan := self.eth.Eventer().Register("blocks") out: for { select { case event := <-blockChan: - block := event.Data.(*Block) - err := self.Process(block, false) - if err != nil { - statelogger.Infoln(err) - statelogger.Debugf("Block #%v failed (%x...)\n", block.Number, block.Hash()[0:4]) - statelogger.Debugln(block) + blocks := event.Data.(Blocks) + for _, block := range blocks { + err := self.Process(block, false) + if err != nil { + statelogger.Infoln(err) + statelogger.Debugf("Block #%v failed (%x...)\n", block.Number, block.Hash()[0:4]) + statelogger.Debugln(block) + break + } } case <-self.quit: |