diff options
author | obscuren <geffobscura@gmail.com> | 2014-06-20 06:42:26 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-06-20 06:42:26 +0800 |
commit | 8f29f6a4d4e2c62d3eff0dfd84cc8cab59dd28e8 (patch) | |
tree | d5f290534ddbbcfe3aba61bd5865e36544f161ce /ethchain/state_transition.go | |
parent | 6fcc6a2f7c35f10a8be3fc90bab39f2865adace9 (diff) | |
download | dexon-8f29f6a4d4e2c62d3eff0dfd84cc8cab59dd28e8.tar dexon-8f29f6a4d4e2c62d3eff0dfd84cc8cab59dd28e8.tar.gz dexon-8f29f6a4d4e2c62d3eff0dfd84cc8cab59dd28e8.tar.bz2 dexon-8f29f6a4d4e2c62d3eff0dfd84cc8cab59dd28e8.tar.lz dexon-8f29f6a4d4e2c62d3eff0dfd84cc8cab59dd28e8.tar.xz dexon-8f29f6a4d4e2c62d3eff0dfd84cc8cab59dd28e8.tar.zst dexon-8f29f6a4d4e2c62d3eff0dfd84cc8cab59dd28e8.zip |
Removed some logging
Diffstat (limited to 'ethchain/state_transition.go')
-rw-r--r-- | ethchain/state_transition.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ethchain/state_transition.go b/ethchain/state_transition.go index 8757246a0..5f4588e48 100644 --- a/ethchain/state_transition.go +++ b/ethchain/state_transition.go @@ -219,25 +219,23 @@ func (self *StateTransition) Transition() (ret []byte, err error) { // and use the return value as the // script section for the state object. self.data = nil - ethutil.Config.Log.Println(ethutil.LogLevelSystem, receiver.Init()) - code, err := self.Eval(receiver.Init(), receiver) - if err != nil { + code, err, deepErr := self.Eval(receiver.Init(), receiver) + if err != nil || deepErr { self.state.ResetStateObject(receiver) - return nil, fmt.Errorf("Error during init script run %v", err) + return nil, fmt.Errorf("Error during init script run %v (deepErr = %v)", err, deepErr) } receiver.script = code } else { if len(receiver.Script()) > 0 { - ethutil.Config.Log.Println(ethutil.LogLevelSystem, receiver.Script()) - - ret, err = self.Eval(receiver.Script(), receiver) + var deepErr bool + ret, err, deepErr = self.Eval(receiver.Script(), receiver) if err != nil { self.state.ResetStateObject(receiver) - return nil, fmt.Errorf("Error during code execution %v", err) + return nil, fmt.Errorf("Error during code execution %v (deepErr = %v)", err, deepErr) } } } @@ -262,7 +260,7 @@ func (self *StateTransition) transferValue(sender, receiver *StateObject) error return nil } -func (self *StateTransition) Eval(script []byte, context *StateObject) (ret []byte, err error) { +func (self *StateTransition) Eval(script []byte, context *StateObject) (ret []byte, err error, deepErr bool) { var ( block = self.block initiator = self.Sender() @@ -282,6 +280,7 @@ func (self *StateTransition) Eval(script []byte, context *StateObject) (ret []by }) vm.Verbose = true ret, _, err = closure.Call(vm, self.data, nil) + deepErr = vm.err != nil return } |