Arpit/reorg fix 2 (#210)

* testing

* author check

* if else fix
This commit is contained in:
Arpit Temani 2021-11-25 12:46:51 +05:30 committed by GitHub
parent 87f9b91b25
commit 6f5915363e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()