Merge branch 'hotfix/2'

This commit is contained in:
obscuren 2014-05-20 22:04:58 +02:00
commit 7dae955c1a
1 changed files with 9 additions and 1 deletions

View File

@ -223,7 +223,15 @@ func (block *Block) SetTransactions(txs []*Transaction) {
trie.Update(strconv.Itoa(i), string(tx.RlpEncode()))
}
block.TxSha = []byte(trie.Root.(string))
switch trie.Root.(type) {
case string:
block.TxSha = []byte(trie.Root.(string))
case []byte:
block.TxSha = trie.Root.([]byte)
default:
panic(fmt.Sprintf("invalid root type %T", trie.Root))
}
}
func (block *Block) Value() *ethutil.Value {