From 5eb68df8f2290ea39a1d85a7e10426a5e8c25237 Mon Sep 17 00:00:00 2001 From: Arran Schlosberg Date: Tue, 26 Nov 2024 09:48:10 +0000 Subject: [PATCH] refactor!: remove `<-sf.stop` case in task loop --- core/state/trie_prefetcher.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/state/trie_prefetcher.go b/core/state/trie_prefetcher.go index e4a12984f75e..275f20b94b69 100644 --- a/core/state/trie_prefetcher.go +++ b/core/state/trie_prefetcher.go @@ -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