From 9d35ab5924b1e1595883ef59c6d7338038274b9e Mon Sep 17 00:00:00 2001 From: welkin22 <136572398+welkin22@users.noreply.github.com> Date: Fri, 5 Jan 2024 10:27:29 +0800 Subject: [PATCH] fix: remove redundant lock (#21) Co-authored-by: Welkin --- core/blockchain.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 9d21cb8e92..9808e48b8a 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -229,7 +229,6 @@ type BlockChain struct { quit chan struct{} // shutdown signal, closed in Stop. running int32 // 0 if chain is running, 1 when stopped procInterrupt int32 // interrupt signaler for block processing - commitLock sync.Mutex // CommitLock is used to protect above field from being modified concurrently engine consensus.Engine validator Validator // Block and state validator interface @@ -1397,8 +1396,6 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types. postCommitFuncs := []func() error{ func() error { - bc.commitLock.Lock() - defer bc.commitLock.Unlock() root := block.Root() // If we're running an archive node, always flush