aboutsummaryrefslogtreecommitdiffstats
path: root/ethvm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-10 17:39:11 +0800
committerobscuren <geffobscura@gmail.com>2014-09-10 17:39:11 +0800
commitc0187930dc352c645c223e17364623a68413cb74 (patch)
tree4397d17557063fe0b0c30791b9737b1b76a65654 /ethvm
parent2f362509b813573f533a5be437c140355ddec7fc (diff)
downloaddexon-c0187930dc352c645c223e17364623a68413cb74.tar
dexon-c0187930dc352c645c223e17364623a68413cb74.tar.gz
dexon-c0187930dc352c645c223e17364623a68413cb74.tar.bz2
dexon-c0187930dc352c645c223e17364623a68413cb74.tar.lz
dexon-c0187930dc352c645c223e17364623a68413cb74.tar.xz
dexon-c0187930dc352c645c223e17364623a68413cb74.tar.zst
dexon-c0187930dc352c645c223e17364623a68413cb74.zip
Removed some commented code
Diffstat (limited to 'ethvm')
-rw-r--r--ethvm/vm.go91
1 files changed, 0 insertions, 91 deletions
diff --git a/ethvm/vm.go b/ethvm/vm.go
index 9518540e0..fba8c4a0e 100644
--- a/ethvm/vm.go
+++ b/ethvm/vm.go
@@ -765,51 +765,7 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
stack.Push(ethutil.BigD(addr))
}
- /*
- msg := self.env.State().Manifest().AddMessage(&ethstate.Message{
- To: addr, From: closure.Address(),
- Origin: self.env.Origin(),
- Block: self.env.BlockHash(), Timestamp: self.env.Time(), Coinbase: self.env.Coinbase(), Number: self.env.BlockNumber(),
- Value: value,
- })
-
- // Create a new contract
- contract := self.env.State().NewStateObject(addr)
- if contract.Balance.Cmp(value) >= 0 {
- closure.object.SubAmount(value)
- contract.AddAmount(value)
-
- // Set the init script
- initCode := mem.Get(offset.Int64(), size.Int64())
- msg.Input = initCode
-
- // Transfer all remaining gas to the new
- // contract so it may run the init script
- gas := new(big.Int).Set(closure.Gas)
- closure.UseGas(closure.Gas)
-
- // Create the closure
- c := NewClosure(msg, closure, contract, initCode, gas, closure.Price)
- // Call the closure and set the return value as
- // main script.
- contract.Code, _, err = c.Call(self, nil)
- } else {
- err = fmt.Errorf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Balance)
- }
-
- if err != nil {
- stack.Push(ethutil.BigFalse)
-
- // Revert the state as it was before.
- self.env.State().Set(snapshot)
-
- self.Printf("CREATE err %v", err)
- } else {
- stack.Push(ethutil.BigD(addr))
- msg.Output = contract.Code
- }
- */
self.Endl()
// Debug hook
@@ -858,53 +814,6 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
self.Dbg.SetCode(closure.Code)
}
- /*
- msg := self.env.State().Manifest().AddMessage(&ethstate.Message{
- To: addr.Bytes(), From: closure.Address(),
- Input: args,
- Origin: self.env.Origin(),
- Block: self.env.BlockHash(), Timestamp: self.env.Time(), Coinbase: self.env.Coinbase(), Number: self.env.BlockNumber(),
- Value: value,
- })
-
- if closure.object.Balance.Cmp(value) < 0 {
- vmlogger.Debugf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Balance)
-
- closure.ReturnGas(gas, nil)
-
- stack.Push(ethutil.BigFalse)
- } else {
- snapshot := self.env.State().Copy()
-
- stateObject := self.env.State().GetOrNewStateObject(addr.Bytes())
-
- closure.object.SubAmount(value)
- stateObject.AddAmount(value)
-
- // Create a new callable closure
- c := NewClosure(msg, closure, stateObject, stateObject.Code, gas, closure.Price)
- // Executer the closure and get the return value (if any)
- ret, _, err := c.Call(self, args)
- if err != nil {
- stack.Push(ethutil.BigFalse)
-
- vmlogger.Debugf("Closure execution failed. %v\n", err)
-
- self.env.State().Set(snapshot)
- } else {
- stack.Push(ethutil.BigTrue)
-
- mem.Set(retOffset.Int64(), retSize.Int64(), ret)
- }
-
- msg.Output = ret
-
- // Debug hook
- if self.Dbg != nil {
- self.Dbg.SetCode(closure.Code)
- }
- }
- */
case POST:
require(6)