diff --git a/ethcore/src/externalities.rs b/ethcore/src/externalities.rs index 23a4a83c3d1..41122afc1df 100644 --- a/ethcore/src/externalities.rs +++ b/ethcore/src/externalities.rs @@ -314,7 +314,11 @@ impl<'a, T: 'a, V: 'a, B: 'a> Ext for Externalities<'a, T, V, B> } fn extcodehash(&self, address: &Address) -> vm::Result> { - Ok(self.state.code_hash(address)?) + if self.state.exists_and_not_null(address)? { + Ok(self.state.code_hash(address)?) + } else { + Ok(None) + } } fn extcodesize(&self, address: &Address) -> vm::Result> {