From 957e9d8d05849c1f1cd32ab84075686cf6f54d77 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Wed, 2 Jul 2025 14:13:06 +0800 Subject: [PATCH] core/state: remove lock #18065 (#1174) --- core/state/statedb.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index ebd948137a..b2c40409a1 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -21,7 +21,6 @@ import ( "fmt" "math/big" "sort" - "sync" "time" "github.com/XinFinOrg/XDPoSChain/common" @@ -82,8 +81,6 @@ type StateDB struct { validRevisions []revision nextRevisionId int - lock sync.Mutex - // Measurements gathered during execution for debugging purposes AccountReads time.Duration AccountHashes time.Duration @@ -630,9 +627,6 @@ func (db *StateDB) ForEachStorage(addr common.Address, cb func(key, value common // Copy creates a deep, independent copy of the state. // Snapshots of the copied state cannot be applied to the copy. func (s *StateDB) Copy() *StateDB { - s.lock.Lock() - defer s.lock.Unlock() - // Copy all the basic fields, initialize the memory ones state := &StateDB{ db: s.db,