diff options
author | obscuren <geffobscura@gmail.com> | 2014-06-17 17:06:06 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-06-17 17:06:06 +0800 |
commit | 53e30f750dd0c91279bfebe01bb12fd170cb74ff (patch) | |
tree | b14fcd5845ce21c774ae7730bdd1d42f8836e5a2 /ethchain/state_transition.go | |
parent | 6656f99c54aef4aaf03ba76dcab3df1cc363ab9a (diff) | |
download | go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar.gz go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar.bz2 go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar.lz go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar.xz go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.tar.zst go-tangerine-53e30f750dd0c91279bfebe01bb12fd170cb74ff.zip |
Removal of manual updating of state objects
* You'll only ever need to update the state by calling Update. Update
will take care of the updating of it's child state objects.
Diffstat (limited to 'ethchain/state_transition.go')
-rw-r--r-- | ethchain/state_transition.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ethchain/state_transition.go b/ethchain/state_transition.go index 25efd64cc..23175b0f3 100644 --- a/ethchain/state_transition.go +++ b/ethchain/state_transition.go @@ -67,13 +67,8 @@ func (self *StateTransition) Receiver() *StateObject { func (self *StateTransition) MakeStateObject(state *State, tx *Transaction) *StateObject { contract := MakeContract(tx, state) - if contract != nil { - state.states[string(tx.CreationAddress())] = contract.state - return contract - } - - return nil + return contract } func (self *StateTransition) UseGas(amount *big.Int) error { @@ -137,6 +132,8 @@ func (self *StateTransition) TransitionState() (err error) { receiver *StateObject ) + ethutil.Config.Log.Printf(ethutil.LogLevelInfo, "(~) %x\n", tx.Hash()) + // Make sure this transaction's nonce is correct if sender.Nonce != tx.Nonce { return NonceError(tx.Nonce, sender.Nonce) @@ -152,15 +149,17 @@ func (self *StateTransition) TransitionState() (err error) { defer func() { self.RefundGas() - if sender != nil { - self.state.UpdateStateObject(sender) - } + /* + if sender != nil { + self.state.UpdateStateObject(sender) + } - if receiver != nil { - self.state.UpdateStateObject(receiver) - } + if receiver != nil { + self.state.UpdateStateObject(receiver) + } - self.state.UpdateStateObject(self.Coinbase()) + self.state.UpdateStateObject(self.Coinbase()) + */ }() // Increment the nonce for the next transaction @@ -209,6 +208,7 @@ func (self *StateTransition) TransitionState() (err error) { receiver.script = code } else { if len(receiver.Script()) > 0 { + fmt.Println(receiver.Script()) _, err := self.Eval(receiver.Script(), receiver) if err != nil { return fmt.Errorf("Error during code execution %v", err) |