aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-05-17 23:51:34 +0800
committerobscuren <geffobscura@gmail.com>2015-05-19 00:16:53 +0800
commitbc5e60cd632b7ee38eb0ea9dcd80e1ca9a4ba4af (patch)
tree5aa3c4f97a656240703317cb50be45d0a329aad3 /miner/worker.go
parentc67424ecc8a75d7c0bc942227a4c4e5c5628d7bc (diff)
downloaddexon-bc5e60cd632b7ee38eb0ea9dcd80e1ca9a4ba4af.tar.gz
dexon-bc5e60cd632b7ee38eb0ea9dcd80e1ca9a4ba4af.tar.zst
dexon-bc5e60cd632b7ee38eb0ea9dcd80e1ca9a4ba4af.zip
miner: stale block notification
Diffstat (limited to 'miner/worker.go')
-rw-r--r--miner/worker.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/miner/worker.go b/miner/worker.go
index d5f9dd8c5..5fa5d3777 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(),