mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-15 20:46:40 +00:00
Let the state create the object
This commit is contained in:
parent
d890258af6
commit
614624754d
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue