Treat empty account the same as non-exist accounts in EIP-1052 (#10775)

This commit is contained in:
Wei Tang 2019-06-25 09:14:16 +02:00 committed by David
parent 6022c47b53
commit d743df549b

View File

@ -315,7 +315,11 @@ impl<'a, T: 'a, V: 'a, B: 'a> Ext for Externalities<'a, T, V, B>
} }
fn extcodehash(&self, address: &Address) -> vm::Result<Option<H256>> { fn extcodehash(&self, address: &Address) -> vm::Result<Option<H256>> {
if self.state.exists_and_not_null(address)? {
Ok(self.state.code_hash(address)?) Ok(self.state.code_hash(address)?)
} else {
Ok(None)
}
} }
fn extcodesize(&self, address: &Address) -> vm::Result<Option<usize>> { fn extcodesize(&self, address: &Address) -> vm::Result<Option<usize>> {