Skip to content

Commit

Permalink
fix getcode issue after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny2022da committed Oct 8, 2024
1 parent e532066 commit 5e70537
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/state/parallel_statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@ func (s *ParallelStateDB) GetCode(addr common.Address) []byte {
return nil
}
dirtyObj = o
} else {
dirtyObj = nil
}

// 1.Try to get from dirty
Expand Down Expand Up @@ -617,8 +619,13 @@ func (s *ParallelStateDB) GetCode(addr common.Address) []byte {
s.parallel.codeReadsInSlot[addr] = code
}
// fixup dirties
if dirtyObj != nil && !bytes.Equal(dirtyObj.code, code) {
dirtyObj.code = code
if dirtyObj != nil {
if dirtyObj.code == nil {
dirtyObj.code = code
}
if !bytes.Equal(dirtyObj.code, code) {
dirtyObj.code = code
}
}
return code
}
Expand Down

0 comments on commit 5e70537

Please sign in to comment.