diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-03-02 20:35:02 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-03-05 20:01:13 +0800 |
commit | b7e57ca1d029d08d214a098d7aa123201b121774 (patch) | |
tree | a6b744b7af001b8bbd2e0e2ef93f11586ab4d38c /core | |
parent | 478143d69a13103a6809ef41a64b25db8c2438ee (diff) | |
download | go-tangerine-b7e57ca1d029d08d214a098d7aa123201b121774.tar.gz go-tangerine-b7e57ca1d029d08d214a098d7aa123201b121774.tar.zst go-tangerine-b7e57ca1d029d08d214a098d7aa123201b121774.zip |
cmd/evm, core/vm, internal/ethapi: don't disable call gas metering
Diffstat (limited to 'core')
-rw-r--r-- | core/vm/interpreter.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index e12dd7e5a..95490adfc 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -37,8 +37,6 @@ type Config struct { // NoRecursion disabled Interpreter call, callcode, // delegate call and create. NoRecursion bool - // Disable gas metering - DisableGasMetering bool // Enable recording of SHA3/keccak preimages EnablePreimageRecording bool // JumpTable contains the EVM instruction table. This @@ -189,14 +187,11 @@ func (in *Interpreter) Run(contract *Contract, input []byte) (ret []byte, err er return nil, errGasUintOverflow } } - - if !in.cfg.DisableGasMetering { - // consume the gas and return an error if not enough gas is available. - // cost is explicitly set so that the capture state defer method cas get the proper cost - cost, err = operation.gasCost(in.gasTable, in.evm, contract, stack, mem, memorySize) - if err != nil || !contract.UseGas(cost) { - return nil, ErrOutOfGas - } + // consume the gas and return an error if not enough gas is available. + // cost is explicitly set so that the capture state defer method cas get the proper cost + cost, err = operation.gasCost(in.gasTable, in.evm, contract, stack, mem, memorySize) + if err != nil || !contract.UseGas(cost) { + return nil, ErrOutOfGas } if memorySize > 0 { mem.Resize(memorySize) |