aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorJason Carver <ut96caarrs@snkmail.com>2015-05-27 09:54:56 +0800
committerJason Carver <ut96caarrs@snkmail.com>2015-05-27 09:54:56 +0800
commit6019f1bb0a0744ffa52bf1ab93309c1a6dd9063c (patch)
tree4a02029a6d0f629831a5e044e146bda3c7e72044 /miner
parentf1ce5877badf5624a5fc5214dc18086b930c8d38 (diff)
downloadgo-tangerine-6019f1bb0a0744ffa52bf1ab93309c1a6dd9063c.tar
go-tangerine-6019f1bb0a0744ffa52bf1ab93309c1a6dd9063c.tar.gz
go-tangerine-6019f1bb0a0744ffa52bf1ab93309c1a6dd9063c.tar.bz2
go-tangerine-6019f1bb0a0744ffa52bf1ab93309c1a6dd9063c.tar.lz
go-tangerine-6019f1bb0a0744ffa52bf1ab93309c1a6dd9063c.tar.xz
go-tangerine-6019f1bb0a0744ffa52bf1ab93309c1a6dd9063c.tar.zst
go-tangerine-6019f1bb0a0744ffa52bf1ab93309c1a6dd9063c.zip
deep-mining-log: only track non-stale blocks
if you track stale blocks, then you quickly overflow your ring buffer in the local network case where you're mining every block and generating a lot of stales.
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/miner/worker.go b/miner/worker.go
index 6f618d632..fac2e6568 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -248,12 +248,12 @@ func (self *worker) wait() {
canonBlock := self.chain.GetBlockByNumber(block.NumberU64())
if canonBlock != nil && canonBlock.Hash() != block.Hash() {
stale = "stale-"
+ } else {
+ self.current.localMinedBlocks = newLocalMinedBlock(block.Number().Uint64(), self.current.localMinedBlocks)
}
glog.V(logger.Info).Infof("🔨 Mined %sblock #%v (%x)", stale, block.Number(), block.Hash().Bytes()[:4])
- self.current.localMinedBlocks = newLocalMinedBlock(block.Number().Uint64(), self.current.localMinedBlocks)
-
jsonlogger.LogJson(&logger.EthMinerNewBlock{
BlockHash: block.Hash().Hex(),
BlockNumber: block.Number(),