|
|
|
@ -253,26 +253,22 @@ func (self *StateTransition) Eval(script []byte, context *StateObject) (ret []by |
|
|
|
|
Value: self.value, |
|
|
|
|
}) |
|
|
|
|
vm.Verbose = true |
|
|
|
|
ret, _, err = closure.Call(vm, self.data, nil) |
|
|
|
|
deepErr = vm.err != nil |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
var testAddr = ethutil.FromHex("ec4f34c97e43fbb2816cfd95e388353c7181dab1") |
|
|
|
|
if bytes.Compare(testAddr, context.Address()) == 0 { |
|
|
|
|
trie := context.state.trie |
|
|
|
|
trie.NewIterator().Each(func(key string, v *ethutil.Value) { |
|
|
|
|
v.Decode() |
|
|
|
|
fmt.Printf("%x : %x\n", key, v.Str()) |
|
|
|
|
}) |
|
|
|
|
fmt.Println("\n\n") |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
ret, err, deepErr = Call(vm, closure, self.data) |
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func Call(vm *Vm, closure *Closure, data []byte) (ret []byte, err error, deepErr bool) { |
|
|
|
|
ret, _, err = closure.Call(vm, data, nil) |
|
|
|
|
deepErr = vm.err != nil |
|
|
|
|
|
|
|
|
|
Paranoia := ethutil.Config.Paranoia |
|
|
|
|
if Paranoia { |
|
|
|
|
var ( |
|
|
|
|
trie = context.state.trie |
|
|
|
|
trie2 = ethutil.NewTrie(ethutil.Config.Db, "") |
|
|
|
|
context = closure.object |
|
|
|
|
trie = context.state.trie |
|
|
|
|
trie2 = ethutil.NewTrie(ethutil.Config.Db, "") |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
trie.NewIterator().Each(func(key string, v *ethutil.Value) { |
|
|
|
@ -282,6 +278,8 @@ func (self *StateTransition) Eval(script []byte, context *StateObject) (ret []by |
|
|
|
|
a := ethutil.NewValue(trie2.Root).Bytes() |
|
|
|
|
b := ethutil.NewValue(context.state.trie.Root).Bytes() |
|
|
|
|
if bytes.Compare(a, b) != 0 { |
|
|
|
|
// TODO FIXME ASAP
|
|
|
|
|
context.state.trie = trie2 |
|
|
|
|
/* |
|
|
|
|
statelogger.Debugf("(o): %x\n", trie.Root) |
|
|
|
|
trie.NewIterator().Each(func(key string, v *ethutil.Value) { |
|
|
|
@ -296,7 +294,7 @@ func (self *StateTransition) Eval(script []byte, context *StateObject) (ret []by |
|
|
|
|
}) |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
return nil, fmt.Errorf("PARANOIA: Different state object roots during copy"), false |
|
|
|
|
//return nil, fmt.Errorf("PARANOIA: Different state object roots during copy"), false
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|