core/vm: avoid state lookup during gas calc for call (#15061)

This commit is contained in:
Martin Holst Swende 2017-09-04 10:56:45 +02:00 committed by Felix Lange
parent dc92779c0a
commit 23b51a68cb

View File

@ -324,7 +324,7 @@ func gasCall(gt params.GasTable, evm *EVM, contract *Contract, stack *Stack, mem
eip158 = evm.ChainConfig().IsEIP158(evm.BlockNumber) eip158 = evm.ChainConfig().IsEIP158(evm.BlockNumber)
) )
if eip158 { if eip158 {
if evm.StateDB.Empty(address) && transfersValue { if transfersValue && evm.StateDB.Empty(address) {
gas += params.CallNewAccountGas gas += params.CallNewAccountGas
} }
} else if !evm.StateDB.Exist(address) { } else if !evm.StateDB.Exist(address) {