mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
core/vm: don't call SetCode after contract creation if initcode didn't return anything (#32916)
The code change is a noop here, and the tracing hook shouldn't be invoked if the account code doesn't actually change.
This commit is contained in:
parent
cfb311148c
commit
b6a4ac9961
1 changed files with 3 additions and 1 deletions
|
|
@ -601,7 +601,9 @@ func (evm *EVM) initNewContract(contract *Contract, address common.Address) ([]b
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
evm.StateDB.SetCode(address, ret, tracing.CodeChangeContractCreation)
|
if len(ret) > 0 {
|
||||||
|
evm.StateDB.SetCode(address, ret, tracing.CodeChangeContractCreation)
|
||||||
|
}
|
||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue