From 26b85e9be1ca5e82f8156163008f8daa62bb117d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 22 Aug 2019 11:48:24 +0300 Subject: [PATCH] core: report 1-block reorgs on the metrics too --- core/blockchain.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 481e1329a7..79300a39d3 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1475,10 +1475,8 @@ func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error { } logFn(msg, "number", commonBlock.Number(), "hash", commonBlock.Hash(), "drop", len(oldChain), "dropfrom", oldChain[0].Hash(), "add", len(newChain), "addfrom", newChain[0].Hash()) - if len(oldChain) > 1 { - blockReorgAddMeter.Mark(int64(len(newChain))) - blockReorgDropMeter.Mark(int64(len(oldChain))) - } + blockReorgAddMeter.Mark(int64(len(newChain))) + blockReorgDropMeter.Mark(int64(len(oldChain))) } else { log.Error("Impossible reorg, please file an issue", "oldnum", oldBlock.Number(), "oldhash", oldBlock.Hash(), "newnum", newBlock.Number(), "newhash", newBlock.Hash()) }