diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-23 21:52:50 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-23 21:52:50 +0800 |
commit | f7d4e3cd6b276e4d66abe89b4f1b2dfa2faf90df (patch) | |
tree | 3b5fafdc020ed80784694ab4acf4c2ce828df9ab | |
parent | 6b08efabf837c9c763e116b91dc9b566a2c76d80 (diff) | |
download | go-tangerine-f7d4e3cd6b276e4d66abe89b4f1b2dfa2faf90df.tar go-tangerine-f7d4e3cd6b276e4d66abe89b4f1b2dfa2faf90df.tar.gz go-tangerine-f7d4e3cd6b276e4d66abe89b4f1b2dfa2faf90df.tar.bz2 go-tangerine-f7d4e3cd6b276e4d66abe89b4f1b2dfa2faf90df.tar.lz go-tangerine-f7d4e3cd6b276e4d66abe89b4f1b2dfa2faf90df.tar.xz go-tangerine-f7d4e3cd6b276e4d66abe89b4f1b2dfa2faf90df.tar.zst go-tangerine-f7d4e3cd6b276e4d66abe89b4f1b2dfa2faf90df.zip |
Copy over bytes from previous root
Copy over instead of directly using the previous root. This is order to
avoid resetting problems
-rw-r--r-- | ethchain/block.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ethchain/block.go b/ethchain/block.go index 8c93947fb..c9197c69a 100644 --- a/ethchain/block.go +++ b/ethchain/block.go @@ -80,6 +80,9 @@ func CreateBlock(root interface{}, extra string, txes []*Transaction) *Block { + // Copy over the bytes + copiedRoot := ethutil.NewValue(root).Bytes() + block := &Block{ // Slice of transactions to include in this block transactions: txes, @@ -95,7 +98,7 @@ func CreateBlock(root interface{}, block.SetTransactions(txes) block.SetUncles([]*Block{}) - block.state = NewState(ethutil.NewTrie(ethutil.Config.Db, root)) + block.state = NewState(ethutil.NewTrie(ethutil.Config.Db, copiedRoot)) for _, tx := range txes { block.MakeContract(tx) |