Commit 61462475 authored by obscuren's avatar obscuren

Let the state create the object

parent d890258a
...@@ -594,7 +594,9 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro ...@@ -594,7 +594,9 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
// Generate a new address // Generate a new address
addr := ethutil.CreateAddress(closure.caller.Address(), closure.caller.N()) addr := ethutil.CreateAddress(closure.caller.Address(), closure.caller.N())
// Create a new contract // Create a new contract
contract := NewContract(addr, value, []byte("")) contract := vm.state.NewStateObject(addr)
contract.Amount = value
// Set the init script // Set the init script
contract.initScript = mem.Get(offset.Int64(), size.Int64()) contract.initScript = mem.Get(offset.Int64(), size.Int64())
// Transfer all remaining gas to the new // Transfer all remaining gas to the new
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment