tracers/prestate: always remove empty accounts from pre-state

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
This commit is contained in:
Ignacio Hagopian 2025-03-18 17:46:28 -03:00
parent c4f0450710
commit 6e813f68ba
No known key found for this signature in database
GPG key ID: DE3D6A6AA8301393

View file

@ -177,11 +177,9 @@ func (t *prestateTracer) OnTxEnd(receipt *types.Receipt, err error) {
if t.config.DiffMode {
t.processDiffState()
}
// the new created contracts' prestate were empty, so delete them
for a := range t.created {
// the created contract maybe exists in statedb before the creating tx
if s := t.pre[a]; s != nil && s.empty {
delete(t.pre, a)
for addr, s := range t.pre {
if s.empty {
delete(t.pre, addr)
}
}
}