Patch eth_call (#6366)

This commit is contained in:
Tomasz Drwięga 2017-08-24 09:16:32 +02:00 committed by Arkadiy Paronyan
parent ddc7b588dc
commit b7324bf771
2 changed files with 2 additions and 2 deletions

View File

@ -736,7 +736,7 @@ impl MinerService for Miner {
let sender = t.sender();
let balance = state.balance(&sender).map_err(ExecutionError::from)?;
let needed_balance = t.value + t.gas * t.gas_price;
let needed_balance = t.value.saturating_add(t.gas.saturating_mul(t.gas_price));
if balance < needed_balance {
// give the sender a sufficient balance
state.add_balance(&sender, &(needed_balance - balance), CleanupMode::NoEmpty)

View File

@ -31,7 +31,7 @@ pub fn sign_call<B: MiningBlockChainClient, M: MinerService>(
gas_cap: bool,
) -> Result<SignedTransaction, Error> {
let from = request.from.unwrap_or(0.into());
let mut gas = request.gas.unwrap_or(U256::max_value());
let mut gas = request.gas.unwrap_or(U256::from(2) << 50);
if gas_cap {
let max_gas = 50_000_000.into();
if gas > max_gas {