diff options
-rw-r--r-- | core/blockchain.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index bb1c14f43..3fb8be15f 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -827,6 +827,11 @@ func (bc *BlockChain) WriteBlock(block *types.Block) (status WriteStatus, err er bc.mu.Lock() defer bc.mu.Unlock() + if bc.HasBlock(block.Hash()) { + log.Trace("Block existed", "hash", block.Hash()) + return + } + localTd := bc.GetTd(bc.currentBlock.Hash(), bc.currentBlock.NumberU64()) externTd := new(big.Int).Add(block.Difficulty(), ptd) |