Skip to content

Commit 4cd93d4

Browse files
committed
always remove empty accounts from pre-state
1 parent 9a47bfe commit 4cd93d4

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

ctxc/tracers/native/prestate.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,12 @@ func (t *prestateTracer) CaptureTxEnd(restGas uint64) {
250250
delete(t.pre, addr)
251251
}
252252
}
253-
// the new created contracts' prestate were empty, so delete them
254-
for a := range t.created {
255-
// the created contract maybe exists in statedb before the creating tx
256-
if s := t.pre[a]; s != nil && !s.exists() {
257-
delete(t.pre, a)
253+
254+
// Remove accounts that were empty prior to execution. Unless
255+
// user requested to include empty accounts.
256+
for addr, s := range t.pre {
257+
if s.empty {
258+
delete(t.pre, addr)
258259
}
259260
}
260261
}

0 commit comments

Comments
 (0)