apply suggestion

> Co-authored-by: Gary Rong <garyrong0905@gmail.com>
This commit is contained in:
Jared Wasinger 2024-05-13 20:54:04 -07:00
parent b01d3a5ddb
commit d9e3bceb92

View file

@ -314,9 +314,12 @@ func (s *stateObject) updateTrie() (Trie, error) {
}
// Retrieve a pretecher populated trie, or fall back to the database
tr := s.getPrefetchedTrie()
if tr == nil {
var err error
if tr != nil {
// Prefetcher returned a live trie, swap it out for the current one
s.trie = tr
} else {
// Fetcher not running or empty trie, fallback to the database trie
var err error
tr, err = s.getTrie()
if err != nil {
s.db.setError(err)