diff options
author | obscuren <geffobscura@gmail.com> | 2015-05-22 00:58:57 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-05-22 00:58:57 +0800 |
commit | 2c1c78a6d9e59de1d4cdeb32737d281814d690f7 (patch) | |
tree | 05471c7e1862733478b08e18bd7ed9419f7f7297 /miner/worker.go | |
parent | 915fc0e581c042a8d4896880d45e680003809254 (diff) | |
parent | 3ea9868b656077c38af5ea8590761c3218ce558e (diff) | |
download | go-tangerine-2c1c78a6d9e59de1d4cdeb32737d281814d690f7.tar go-tangerine-2c1c78a6d9e59de1d4cdeb32737d281814d690f7.tar.gz go-tangerine-2c1c78a6d9e59de1d4cdeb32737d281814d690f7.tar.bz2 go-tangerine-2c1c78a6d9e59de1d4cdeb32737d281814d690f7.tar.lz go-tangerine-2c1c78a6d9e59de1d4cdeb32737d281814d690f7.tar.xz go-tangerine-2c1c78a6d9e59de1d4cdeb32737d281814d690f7.tar.zst go-tangerine-2c1c78a6d9e59de1d4cdeb32737d281814d690f7.zip |
Merge branch 'release/0.9.23'v0.9.23
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() { |