aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-10-20 20:27:47 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-11-13 17:44:04 +0800
commit779ddb183275ed506ebae972876fe04098c738e5 (patch)
tree6d52a07ce591b8eb5e9a57b40051cd5e705a3ce2 /core
parent445feaeef58bd89a113743dccf6fd5df55cde6fa (diff)
downloaddexon-779ddb183275ed506ebae972876fe04098c738e5.tar
dexon-779ddb183275ed506ebae972876fe04098c738e5.tar.gz
dexon-779ddb183275ed506ebae972876fe04098c738e5.tar.bz2
dexon-779ddb183275ed506ebae972876fe04098c738e5.tar.lz
dexon-779ddb183275ed506ebae972876fe04098c738e5.tar.xz
dexon-779ddb183275ed506ebae972876fe04098c738e5.tar.zst
dexon-779ddb183275ed506ebae972876fe04098c738e5.zip
core/vm, params: EIP160: EXP reprice
Diffstat (limited to 'core')
-rw-r--r--core/vm/vm.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/vm/vm.go b/core/vm/vm.go
index 6e316acda..56aca6912 100644
--- a/core/vm/vm.go
+++ b/core/vm/vm.go
@@ -313,7 +313,8 @@ func calculateGasAndSize(gasTable params.GasTable, env Environment, contract *Co
quadMemGas(mem, newMemSize, gas)
case EXP:
- gas.Add(gas, new(big.Int).Mul(big.NewInt(int64(len(stack.data[stack.len()-2].Bytes()))), params.ExpByteGas))
+ expByteLen := int64((stack.data[stack.len()-2].BitLen() + 7) / 8)
+ gas.Add(gas, new(big.Int).Mul(big.NewInt(expByteLen), gasTable.ExpByte))
case SSTORE:
err := stack.require(2)
if err != nil {