Skip to content

Commit c262b76

Browse files
committed
core/state: fix datarace
1 parent df8db52 commit c262b76

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

core/state/trie_prefetcher.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,7 @@ func (p *TriePrefetcher) Loop() {
184184
// Retrieve all the tasks queued up and reset the sets for new insertions
185185
p.taskLock.Lock()
186186
accountTasks, storageTasks := p.accountTasks, p.storageTasks
187-
if len(accountTasks) > 0 {
188-
p.accountTasks = nil
189-
}
190-
if len(storageTasks) > 0 {
191-
p.storageTasks = make(map[common.Hash][]common.Hash)
192-
}
187+
p.accountTasks, p.storageTasks = nil, make(map[common.Hash][]common.Hash)
193188
p.taskLock.Unlock()
194189

195190
// Keep prefetching the data until an interruption is triggered

0 commit comments

Comments
 (0)