aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-04-23 21:52:50 +0800
committerobscuren <geffobscura@gmail.com>2014-04-23 21:52:50 +0800
commitf7d4e3cd6b276e4d66abe89b4f1b2dfa2faf90df (patch)
tree3b5fafdc020ed80784694ab4acf4c2ce828df9ab /ethchain
parent6b08efabf837c9c763e116b91dc9b566a2c76d80 (diff)
downloadgo-tangerine-f7d4e3cd6b276e4d66abe89b4f1b2dfa2faf90df.tar.gz
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
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/block.go5
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)