triedb/pathdb: no need lock

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2025-10-25 03:19:20 +00:00
parent b45b0419d7
commit c9cd48a8fb

View file

@ -335,7 +335,6 @@ func (l *lookup) addStorageNodes(state common.Hash, nodes map[common.Hash]map[st
var ( var (
wg sync.WaitGroup wg sync.WaitGroup
locks [storageNodesShardCount]sync.Mutex
tasks = make([][]shardTask, storageNodesShardCount) tasks = make([][]shardTask, storageNodesShardCount)
) )
@ -361,9 +360,6 @@ func (l *lookup) addStorageNodes(state common.Hash, nodes map[common.Hash]map[st
return return
} }
locks[shardIdx].Lock()
defer locks[shardIdx].Unlock()
shard := l.storageNodes[shardIdx] shard := l.storageNodes[shardIdx]
for _, task := range taskList { for _, task := range taskList {
key := makeTrienodeKey(task.accountHash, task.path) key := makeTrienodeKey(task.accountHash, task.path)
@ -477,7 +473,6 @@ func (l *lookup) removeStorageNodes(state common.Hash, nodes map[common.Hash]map
var ( var (
eg errgroup.Group eg errgroup.Group
locks [storageNodesShardCount]sync.Mutex
tasks = make([][]shardTask, storageNodesShardCount) tasks = make([][]shardTask, storageNodesShardCount)
) )
@ -501,9 +496,6 @@ func (l *lookup) removeStorageNodes(state common.Hash, nodes map[common.Hash]map
return nil return nil
} }
locks[shardIdx].Lock()
defer locks[shardIdx].Unlock()
shard := l.storageNodes[shardIdx] shard := l.storageNodes[shardIdx]
for _, task := range taskList { for _, task := range taskList {
key := makeTrienodeKey(task.accountHash, task.path) key := makeTrienodeKey(task.accountHash, task.path)