No longer store script directly in the state tree

This commit is contained in:
obscuren
2014-05-20 11:19:07 +02:00
parent a2fb265563
commit fd19142c0d
11 changed files with 70 additions and 52 deletions

View File

@ -87,7 +87,7 @@ func (sm *StateManager) BlockChain() *BlockChain {
func (sm *StateManager) MakeContract(state *State, tx *Transaction) *StateObject {
contract := MakeContract(tx, state)
if contract != nil {
state.states[string(tx.Hash()[12:])] = contract.state
state.states[string(tx.CreationAddress())] = contract.state
return contract
}
@ -117,7 +117,8 @@ func (sm *StateManager) ApplyTransactions(state *State, block *Block, txs []*Tra
}
} else {
err := sm.Ethereum.TxPool().ProcessTransaction(tx, block, false)
contract := state.GetContract(tx.Recipient)
contract := state.GetStateObject(tx.Recipient)
ethutil.Config.Log.Debugf("contract recip %x\n", tx.Recipient)
if err == nil && len(contract.Script()) > 0 {
sm.EvalScript(state, contract.Script(), contract, tx, block)
} else if err != nil {