executive checks schedule exceptional code deposit before returning OutOfGas

This commit is contained in:
debris 2016-01-12 14:56:19 +01:00
parent f7af71e272
commit 1aa62691c6

View File

@ -419,7 +419,10 @@ impl<'a> Ext for Externalities<'a> {
&mut OutputPolicy::InitContract => {
let return_cost = data.len() as u64 * self.schedule.create_data_gas as u64;
if return_cost > gas {
return Err(evm::Error::OutOfGas);
match self.schedule.exceptional_failed_code_deposit {
true => return Err(evm::Error::OutOfGas),
false => return Ok(gas)
}
}
let mut code = vec![];
code.reserve(data.len());