aboutsummaryrefslogtreecommitdiffstats
path: root/core/state_transition.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-19 20:59:49 +0800
committerobscuren <geffobscura@gmail.com>2014-12-19 20:59:49 +0800
commitf5b8f3d41b533d51eb81e895ed9b6aa31d7aaaef (patch)
tree1b8cf4b18039278254c4ece4b1f2e2d12a8f91d9 /core/state_transition.go
parent0e93b98533968f4a0033ec6214391f5ca647a956 (diff)
downloaddexon-f5b8f3d41b533d51eb81e895ed9b6aa31d7aaaef.tar.gz
dexon-f5b8f3d41b533d51eb81e895ed9b6aa31d7aaaef.tar.zst
dexon-f5b8f3d41b533d51eb81e895ed9b6aa31d7aaaef.zip
Removed OOG check. Revert should always happen.
Diffstat (limited to 'core/state_transition.go')
-rw-r--r--core/state_transition.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/state_transition.go b/core/state_transition.go
index a54246eba..a60f31e3e 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -189,12 +189,19 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
self.rec = MakeContract(msg, self.state)
ret, err, ref = vmenv.Create(sender, self.rec.Address(), self.msg.Data(), self.gas, self.gasPrice, self.value)
- ref.SetCode(ret)
+ if err == nil {
+ dataGas := big.NewInt(int64(len(ret)))
+ dataGas.Mul(dataGas, vm.GasCreateByte)
+ if err = self.UseGas(dataGas); err == nil {
+ ref.SetCode(ret)
+ }
+ }
} else {
ret, err = vmenv.Call(self.From(), self.To().Address(), self.msg.Data(), self.gas, self.gasPrice, self.value)
}
+
if err != nil {
- statelogger.Debugln(err)
+ self.UseGas(self.gas)
}
return