From 1aa62691c67bd17613d6c7a54130d6773a1cb917 Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 12 Jan 2016 14:56:19 +0100 Subject: [PATCH] executive checks schedule exceptional code deposit before returning OutOfGas --- src/executive.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/executive.rs b/src/executive.rs index 62928b5b6..402b7927c 100644 --- a/src/executive.rs +++ b/src/executive.rs @@ -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());