Skip to content

Commit

Permalink
fix: remove redundant lock (#21)
Browse files Browse the repository at this point in the history
Co-authored-by: Welkin <welkin.b@nodereal.com>
  • Loading branch information
welkin22 and Welkin authored Jan 5, 2024
1 parent edd4395 commit 9d35ab5
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9d35ab5

Please sign in to comment.