aboutsummaryrefslogtreecommitdiffstats
path: root/core/execution.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/execution.go')
-rw-r--r--core/execution.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/execution.go b/core/execution.go
index 4a69cce09..be45eeeb4 100644
--- a/core/execution.go
+++ b/core/execution.go
@@ -25,10 +25,7 @@ func (self *Execution) Addr() []byte {
func (self *Execution) Call(codeAddr []byte, caller vm.ContextRef) ([]byte, error) {
// Retrieve the executing code
- var code []byte
- if self.env.State().GetStateObject(codeAddr) != nil {
- code = self.env.State().GetCode(codeAddr)
- }
+ code := self.env.State().GetCode(codeAddr)
return self.exec(code, codeAddr, caller)
}
@@ -62,7 +59,11 @@ func (self *Execution) exec(code, contextAddr []byte, caller vm.ContextRef) (ret
snapshot := env.State().Copy()
start := time.Now()
- ret, err = evm.Run(to, caller, code, self.value, self.Gas, self.price, self.input)
+
+ context := vm.NewContext(caller, to, self.value, self.Gas, self.price)
+ context.SetCallCode(contextAddr, code)
+
+ ret, err = evm.Run(context, self.input) //self.value, self.Gas, self.price, self.input)
chainlogger.Debugf("vm took %v\n", time.Since(start))
if err != nil {
env.State().Set(snapshot)