mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
eth/tracers: fix codehash in prestate diffmode
This commit is contained in:
parent
bd6530a1d4
commit
50aceba6c4
1 changed files with 8 additions and 1 deletions
|
|
@ -277,7 +277,14 @@ func (t *prestateTracer) processDiffState() {
|
|||
}
|
||||
if newCodeHash != prevCodeHash {
|
||||
modified = true
|
||||
postAccount.CodeHash = &newCodeHash
|
||||
// If code was cleared, report the canonical empty code hash
|
||||
// rather than the zero hash used for comparison.
|
||||
if newCodeHash == (common.Hash{}) {
|
||||
emptyHash := types.EmptyCodeHash
|
||||
postAccount.CodeHash = &emptyHash
|
||||
} else {
|
||||
postAccount.CodeHash = &newCodeHash
|
||||
}
|
||||
}
|
||||
if !t.config.DisableCode {
|
||||
newCode := t.env.StateDB.GetCode(addr)
|
||||
|
|
|
|||
Loading…
Reference in a new issue