From 614624754d2dcaf9344a3efbfa880c9b0ddba6be Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 23 Jun 2014 13:42:30 +0200 Subject: [PATCH] Let the state create the object --- ethchain/vm.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ethchain/vm.go b/ethchain/vm.go index a2e1c60fd..432bc4e6d 100644 --- a/ethchain/vm.go +++ b/ethchain/vm.go @@ -594,7 +594,9 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro // Generate a new address addr := ethutil.CreateAddress(closure.caller.Address(), closure.caller.N()) // Create a new contract - contract := NewContract(addr, value, []byte("")) + contract := vm.state.NewStateObject(addr) + contract.Amount = value + // Set the init script contract.initScript = mem.Get(offset.Int64(), size.Int64()) // Transfer all remaining gas to the new