Skip to content

Commit 13196b8

Browse files
committed
address feedback
1 parent 5508e36 commit 13196b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/state/trie_prefetcher.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (p *triePrefetcher) close() {
103103
p.closed = true
104104
}
105105

106-
// prefetch schedules a batch of trie items to prefetch.
106+
// prefetch schedules a batch of trie items to prefetch. After the prefetcher is closed, all the following tasks scheduled will not be executed.
107107
//
108108
// prefetch is called from two locations:
109109
// 1. Finalize of the state-objects storage roots. This happens at the end
@@ -126,7 +126,7 @@ func (p *triePrefetcher) prefetch(owner common.Hash, root common.Hash, addr comm
126126
func (p *triePrefetcher) trie(owner common.Hash, root common.Hash) Trie {
127127
// Bail if no trie was prefetched for this root
128128
fetcher := p.fetchers[p.trieID(owner, root)]
129-
if fetcher == nil {
129+
if fetcher == nil || fetcher.trie == nil {
130130
p.deliveryMissMeter.Mark(1)
131131
return nil
132132
}

0 commit comments

Comments
 (0)