diff options
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r-- | core/chain_manager.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go index 4bf9e9aed..ff37ea28a 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -410,7 +410,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error { for i, block := range chain { // Call in to the block processor and check for errors. It's likely that if one block fails // all others will fail too (unless a known block is returned). - td, err := self.processor.Process(block) + td, logs, err := self.processor.Process(block) if err != nil { if IsKnownBlockErr(err) { continue @@ -438,29 +438,27 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error { hash := block.Hash() chainlogger.Infof("Split detected. New head #%v (%x) TD=%v, was #%v (%x) TD=%v\n", block.Header().Number, hash[:4], td, cblock.Header().Number, chash[:4], self.td) - queue[i] = ChainSplitEvent{block} + queue[i] = ChainSplitEvent{block, logs} queueEvent.splitCount++ } self.setTotalDifficulty(td) self.insert(block) - /* XXX crashes jsonlogger.LogJson(&logger.EthChainNewHead{ - BlockHash: common.Bytes2Hex(block.Hash()), + BlockHash: block.Hash().Hex(), BlockNumber: block.Number(), - ChainHeadHash: common.Bytes2Hex(cblock.Hash()), - BlockPrevHash: common.Bytes2Hex(block.ParentHash()), + ChainHeadHash: cblock.Hash().Hex(), + BlockPrevHash: block.ParentHash().Hex(), }) - */ self.setTransState(state.New(block.Root(), self.stateDb)) self.setTxState(state.New(block.Root(), self.stateDb)) - queue[i] = ChainEvent{block} + queue[i] = ChainEvent{block, logs} queueEvent.canonicalCount++ } else { - queue[i] = ChainSideEvent{block} + queue[i] = ChainSideEvent{block, logs} queueEvent.sideCount++ } } |