From 600852a5cb9a58334bbf46115780ef1968c559e3 Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Fri, 5 Oct 2018 16:28:10 -0400 Subject: [PATCH] reverted change on the core/blockchain.go --- core/blockchain.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index c4515dabd..c5e50695a 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -89,10 +89,9 @@ type BlockChain struct { scope event.SubscriptionScope genesisBlock *types.Block - mu sync.RWMutex // global mutex for locking chain operations - chainmu sync.RWMutex // blockchain insertion lock - procmu sync.RWMutex // block processor lock - insertmu sync.Mutex // block and state insert lock + mu sync.RWMutex // global mutex for locking chain operations + chainmu sync.RWMutex // blockchain insertion lock + procmu sync.RWMutex // block processor lock checkpoint int // checkpoint counts towards the new checkpoint currentBlock *types.Block // Current head of the block chain @@ -814,16 +813,6 @@ func (bc *BlockChain) WriteBlockAndState(block *types.Block, receipts []*types.R bc.wg.Add(1) defer bc.wg.Done() - bc.insertmu.Lock() - defer bc.insertmu.Unlock() - - if bc.config.IsQuorum && bc.config.Istanbul != nil { - if bc.GetBlockByHash(block.Hash()) != nil { - log.Warn("Block already inserted", "number", block.NumberU64(), "hash", block.Hash()) - return CanonStatTy, nil - } - } - // Calculate the total difficulty of the block ptd := bc.GetTd(block.ParentHash(), block.NumberU64()-1) if ptd == nil {