rpc: cap gas limit of local calls (#8943)

This commit is contained in:
André Silva 2018-06-22 10:12:57 +01:00 committed by Tomasz Drwięga
parent 09ecd0c583
commit 6509e90c36

View File

@ -15,7 +15,6 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>. // along with Parity. If not, see <http://www.gnu.org/licenses/>.
use transaction::{Transaction, SignedTransaction, Action}; use transaction::{Transaction, SignedTransaction, Action};
use ethereum_types::U256;
use jsonrpc_core::Error; use jsonrpc_core::Error;
use v1::helpers::CallRequest; use v1::helpers::CallRequest;
@ -29,7 +28,7 @@ pub fn sign_call(request: CallRequest, gas_cap: bool) -> Result<SignedTransactio
} }
Some(gas) => gas, Some(gas) => gas,
None if gas_cap => max_gas, None if gas_cap => max_gas,
None => U256::from(2) << 50, None => max_gas * 10,
}; };
let from = request.from.unwrap_or(0.into()); let from = request.from.unwrap_or(0.into());