From 01c6d54e31426b6ddb3a18171479ceb858832c5b Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Thu, 1 Sep 2022 15:34:32 +0800 Subject: [PATCH] core/state: filter out nil trie for copy (#25575) --- core/state/trie_prefetcher.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/state/trie_prefetcher.go b/core/state/trie_prefetcher.go index 83e8966d4c9f5..678774a62b764 100644 --- a/core/state/trie_prefetcher.go +++ b/core/state/trie_prefetcher.go @@ -126,6 +126,9 @@ func (p *triePrefetcher) copy() *triePrefetcher { // If the prefetcher is already a copy, duplicate the data if p.fetches != nil { for root, fetch := range p.fetches { + if fetch == nil { + continue + } copy.fetches[root] = p.db.CopyTrie(fetch) } return copy