From 6f5915363e57c61457d35c9f492628a54b0ad110 Mon Sep 17 00:00:00 2001 From: Arpit Temani Date: Thu, 25 Nov 2021 12:46:51 +0530 Subject: [PATCH] Arpit/reorg fix 2 (#210) * testing * author check * if else fix --- miner/worker.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index 8bdb1eff7c..9412446eed 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -606,6 +606,15 @@ func (w *worker) resultLoop() { if w.chain.HasBlock(block.Hash(), block.NumberU64()) { continue } + oldBlock := w.chain.GetBlockByNumber(block.NumberU64()) + if oldBlock != nil { + oldBlockAuthor, _ := w.chain.Engine().Author(oldBlock.Header()) + newBlockAuthor, _ := w.chain.Engine().Author(block.Header()) + if oldBlockAuthor == newBlockAuthor { + log.Info("same block ", "height", block.NumberU64()) + continue + } + } var ( sealhash = w.engine.SealHash(block.Header()) hash = block.Hash()