From 0f76a1c6df44bc3242a64e76bef66dfe312d259b Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 15 May 2015 00:41:27 +0200 Subject: core: changed how head events are checked --- core/chain_manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/chain_manager.go') diff --git a/core/chain_manager.go b/core/chain_manager.go index 9f6d7f823..2c96c243c 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -593,7 +593,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) { self.setTransState(state.New(block.Root(), self.stateDb)) self.txState.SetState(state.New(block.Root(), self.stateDb)) - queue[i] = ChainEvent{block, logs} + queue[i] = ChainEvent{block, block.Hash(), logs} queueEvent.canonicalCount++ if glog.V(logger.Debug) { @@ -683,7 +683,7 @@ out: case ChainEvent: // We need some control over the mining operation. Acquiring locks and waiting for the miner to create new block takes too long // and in most cases isn't even necessary. - if i+1 == ev.canonicalCount { + if self.lastBlockHash == event.Hash { self.currentGasLimit = CalcGasLimit(event.Block) self.eventMux.Post(ChainHeadEvent{event.Block}) } -- cgit