diff options
Diffstat (limited to 'miner/worker.go')
-rw-r--r-- | miner/worker.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/miner/worker.go b/miner/worker.go index d5f9dd8c5..5e4ff7510 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -224,7 +224,13 @@ func (self *worker) wait() { } self.mux.Post(core.NewMinedBlockEvent{block}) - glog.V(logger.Info).Infof("🔨 Mined block #%v", block.Number()) + var stale string + canonBlock := self.chain.GetBlockByNumber(block.NumberU64()) + if canonBlock != nil && canonBlock.Hash() != block.Hash() { + stale = "stale-" + } + + glog.V(logger.Info).Infof("🔨 Mined %sblock #%v (%x)", stale, block.Number(), block.Hash().Bytes()[:4]) jsonlogger.LogJson(&logger.EthMinerNewBlock{ BlockHash: block.Hash().Hex(), @@ -264,6 +270,7 @@ func (self *worker) makeCurrent() { } block.Header().Extra = self.extra + // when 08 is processed ancestors contain 07 (quick block) current := env(block, self.eth) for _, ancestor := range self.chain.GetAncestors(block, 7) { for _, uncle := range ancestor.Uncles() { |