good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit d0675e9d authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub
Browse files

Merge pull request #17982 from holiman/polish_contantinople_extcodehash

core/vm: check empty in extcodehash
parents bd519ab8 1b6fd032
No related branches found
No related tags found
No related merge requests found
......@@ -544,7 +544,12 @@ func opExtCodeCopy(pc *uint64, interpreter *EVMInterpreter, contract *Contract,
// this account should be regarded as a non-existent account and zero should be returned.
func opExtCodeHash(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
slot := stack.peek()
slot.SetBytes(interpreter.evm.StateDB.GetCodeHash(common.BigToAddress(slot)).Bytes())
address := common.BigToAddress(slot)
if interpreter.evm.StateDB.Empty(address) {
slot.SetUint64(0)
} else {
slot.SetBytes(interpreter.evm.StateDB.GetCodeHash(address).Bytes())
}
return nil, nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment