diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-24 19:45:21 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-24 19:45:21 +0800 |
commit | 95a8ebc2495476c5dbe6c35f30629ca11f660b86 (patch) | |
tree | f52e497482f81e66383e6069328b9840474b569e /ethchain/block.go | |
parent | 88a9c62fccd16a782e7d7221daf6b6f207c22097 (diff) | |
download | go-tangerine-95a8ebc2495476c5dbe6c35f30629ca11f660b86.tar.gz go-tangerine-95a8ebc2495476c5dbe6c35f30629ca11f660b86.tar.zst go-tangerine-95a8ebc2495476c5dbe6c35f30629ca11f660b86.zip |
Changed MakeContract on block
MakeContract in Block is now using the MakeContract defined in
contract.go
Diffstat (limited to 'ethchain/block.go')
-rw-r--r-- | ethchain/block.go | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/ethchain/block.go b/ethchain/block.go index 0b4f93e8c..7ad9984be 100644 --- a/ethchain/block.go +++ b/ethchain/block.go @@ -220,23 +220,9 @@ func (block *Block) Undo() { } func (block *Block) MakeContract(tx *Transaction) { - // Create contract if there's no recipient - if tx.IsContract() { - addr := tx.Hash()[12:] - - value := tx.Value - contract := NewContract(value, []byte("")) - block.state.Update(string(addr), string(contract.RlpEncode())) - for i, val := range tx.Data { - if len(val) > 0 { - bytNum := ethutil.BigToBytes(big.NewInt(int64(i)), 256) - contract.state.Update(string(bytNum), val) - } - } - block.UpdateContract(addr, contract) + contract := MakeContract(tx, NewState(block.state)) - block.contractStates[string(addr)] = contract.state - } + block.contractStates[string(tx.Hash()[12:])] = contract.state } /////// Block Encoding |