Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
setunapo committed Jul 4, 2022
1 parent a5a7fa8 commit 568fdd6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ func (s *StateDB) StopPrefetcher() {
}

func (s *StateDB) TriePrefetchInAdvance(block *types.Block, signer types.Signer) {
if s.prefetcher == nil {
return
}
accounts := make(map[common.Address]struct{}, block.Transactions().Len()<<1)
for _, tx := range block.Transactions() {
from, err := types.Sender(signer, tx)
Expand All @@ -240,7 +243,7 @@ func (s *StateDB) TriePrefetchInAdvance(block *types.Block, signer types.Signer)
addressesToPrefetch = append(addressesToPrefetch, common.CopyBytes(addr[:])) // Copy needed for closure
}

if s.prefetcher != nil && len(addressesToPrefetch) > 0 {
if len(addressesToPrefetch) > 0 {
s.prefetcher.prefetch(s.originalRoot, addressesToPrefetch, emptyAddr)
}
}
Expand Down

0 comments on commit 568fdd6

Please sign in to comment.