Skip to content

Commit

Permalink
Arpit/reorg fix 2 (#210)
Browse files Browse the repository at this point in the history
* testing

* author check

* if else fix
  • Loading branch information
temaniarpit27 authored Nov 25, 2021
1 parent 87f9b91 commit 6f59153
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6f59153

Please sign in to comment.