EXP simplified

This commit is contained in:
obscuren 2014-12-05 14:52:36 +01:00
parent d80f8bda94
commit 095cb97675
1 changed files with 1 additions and 7 deletions

View File

@ -166,13 +166,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
case EXP:
require(2)
exp := new(big.Int).Set(stack.data[stack.Len()-2])
nbytes := 0
for exp.Cmp(ethutil.Big0) > 0 {
nbytes += 1
exp.Rsh(exp, 8)
}
gas.Set(big.NewInt(int64(nbytes + 1)))
gas.Set(big.NewInt(int64(len(stack.data[stack.Len()-2].Bytes()) + 1)))
// Gas only
case STOP:
gas.Set(ethutil.Big0)