aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-22 06:25:02 +0800
committerobscuren <geffobscura@gmail.com>2014-05-22 06:25:02 +0800
commitf8f84ef0953534f44c3ce7c9630c569b1059e4bd (patch)
tree6532cf0f72cf6ca9f138d66a24918e94b6ff7dcc
parente1b7bd51ee5c1310259af450c6455603e5d19fd9 (diff)
downloadgo-tangerine-f8f84ef0953534f44c3ce7c9630c569b1059e4bd.tar
go-tangerine-f8f84ef0953534f44c3ce7c9630c569b1059e4bd.tar.gz
go-tangerine-f8f84ef0953534f44c3ce7c9630c569b1059e4bd.tar.bz2
go-tangerine-f8f84ef0953534f44c3ce7c9630c569b1059e4bd.tar.lz
go-tangerine-f8f84ef0953534f44c3ce7c9630c569b1059e4bd.tar.xz
go-tangerine-f8f84ef0953534f44c3ce7c9630c569b1059e4bd.tar.zst
go-tangerine-f8f84ef0953534f44c3ce7c9630c569b1059e4bd.zip
Removed old contract creation code
-rw-r--r--ethchain/block.go37
1 files changed, 11 insertions, 26 deletions
diff --git a/ethchain/block.go b/ethchain/block.go
index 24ff5a32f..3401632b1 100644
--- a/ethchain/block.go
+++ b/ethchain/block.go
@@ -56,8 +56,6 @@ type Block struct {
// List of transactions and/or contracts
transactions []*Transaction
TxSha []byte
-
- contractStates map[string]*ethutil.Trie
}
// New block takes a raw encoded string
@@ -91,28 +89,23 @@ func CreateBlock(root interface{},
block := &Block{
// Slice of transactions to include in this block
- transactions: txes,
- PrevHash: prevHash,
- Coinbase: base,
- Difficulty: Difficulty,
- Nonce: Nonce,
- Time: time.Now().Unix(),
- Extra: extra,
- UncleSha: EmptyShaList,
- GasUsed: new(big.Int),
- MinGasPrice: new(big.Int),
- GasLimit: new(big.Int),
- contractStates: make(map[string]*ethutil.Trie),
+ transactions: txes,
+ PrevHash: prevHash,
+ Coinbase: base,
+ Difficulty: Difficulty,
+ Nonce: Nonce,
+ Time: time.Now().Unix(),
+ Extra: extra,
+ UncleSha: EmptyShaList,
+ GasUsed: new(big.Int),
+ MinGasPrice: new(big.Int),
+ GasLimit: new(big.Int),
}
block.SetTransactions(txes)
block.SetUncles([]*Block{})
block.state = NewState(ethutil.NewTrie(ethutil.Config.Db, root))
- for _, tx := range txes {
- block.MakeContract(tx)
- }
-
return block
}
@@ -178,13 +171,6 @@ func (block *Block) Undo() {
block.state.Reset()
}
-func (block *Block) MakeContract(tx *Transaction) {
- contract := MakeContract(tx, block.state)
- if contract != nil {
- block.state.states[string(tx.Hash()[12:])] = contract.state
- }
-}
-
/////// Block Encoding
func (block *Block) rlpTxs() interface{} {
// Marshal the transactions of this block
@@ -265,7 +251,6 @@ func (block *Block) RlpValueDecode(decoder *ethutil.Value) {
block.Time = int64(header.Get(10).BigInt().Uint64())
block.Extra = header.Get(11).Str()
block.Nonce = header.Get(12).Bytes()
- block.contractStates = make(map[string]*ethutil.Trie)
// Tx list might be empty if this is an uncle. Uncles only have their
// header set.