diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-10-15 00:32:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-15 00:32:11 +0800 |
commit | 81b01f1c2bba8340f9cf2bf1da8ef131e3decd50 (patch) | |
tree | 0b2269cb3dfa9719cf3bf7a828c49b0c1ffccab8 /core/vm/instructions.go | |
parent | a4d9e63d12c80a14294c0d085de6bf711ceec779 (diff) | |
parent | 64af2aafdaf16d0bab4c2b89573324b076602bab (diff) | |
download | go-tangerine-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar go-tangerine-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar.gz go-tangerine-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar.bz2 go-tangerine-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar.lz go-tangerine-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar.xz go-tangerine-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar.zst go-tangerine-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.zip |
Merge pull request #3111 from obscuren/gas-price-fork
core, core/vm: added gas price variance table (EIP #150)
Diffstat (limited to 'core/vm/instructions.go')
-rw-r--r-- | core/vm/instructions.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 79aee60d2..3352877c1 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -514,7 +514,12 @@ func opCreate(instr instruction, pc *uint64, env Environment, contract *Contract input = memory.Get(offset.Int64(), size.Int64()) gas = new(big.Int).Set(contract.Gas) ) - contract.UseGas(contract.Gas) + if env.RuleSet().GasTable(env.BlockNumber()).CreateBySuicide != nil { + gas.Div(gas, n64) + gas = gas.Sub(contract.Gas, gas) + } + + contract.UseGas(gas) _, addr, suberr := env.Create(contract, input, gas, contract.Price, value) // Push item on the stack based on the returned error. If the ruleset is // homestead we must check for CodeStoreOutOfGasError (homestead only |