Skip to content

Commit

Permalink
fix the logic to check records with BlockNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
calmbeing committed Jun 30, 2023
1 parent e4f2745 commit 4484423
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/state/plain_readonly.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (s *PlainState) ReadAccountData(address libcommon.Address) (*accounts.Accou
//restore codehash
if records, ok := s.systemContractLookup[address]; ok {
p := sort.Search(len(records), func(i int) bool {
return records[i].BlockNumber > s.blockNr
return records[i].BlockNumber >= s.blockNr
})
a.CodeHash = records[p-1].CodeHash
} else if a.Incarnation > 0 && a.IsEmptyCodeHash() {
Expand Down

0 comments on commit 4484423

Please sign in to comment.