Skip to content

Commit

Permalink
refactor!: remove <-sf.stop case in task loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR4N committed Nov 26, 2024
1 parent 2553546 commit 5eb68df
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/state/trie_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,14 @@ func (sf *subfetcher) loop() {
sf.lock.Unlock()

// Prefetch any tasks until the loop is interrupted
for i, task := range tasks {
for _, task := range tasks {
select {
case <-sf.stop:
// If termination is requested, add any leftover back and return
sf.lock.Lock()
sf.tasks = append(sf.tasks, tasks[i:]...)
sf.lock.Unlock()
return
//libevm:start
//
// The <-sf.stop case has been removed, in keeping with the equivalent change below. Future geth
// versions also remove it so our modification here can be undone when merging upstream.
//
//libevm:end

case ch := <-sf.copy:
// Somebody wants a copy of the current trie, grant them
Expand Down

0 comments on commit 5eb68df

Please sign in to comment.