diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-21 04:05:04 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-21 04:05:04 +0800 |
commit | 27aae603817d2fed69099184b56f04c3d29fe2c6 (patch) | |
tree | 51ebdf31ab7be376d226a64d4156967c826fe7c6 | |
parent | de87e436abd1f04545440a0874015732c1e96480 (diff) | |
parent | 3b38df085ebebd68f1bf76c11c8b87ae75f29fe2 (diff) | |
download | go-tangerine-27aae603817d2fed69099184b56f04c3d29fe2c6.tar go-tangerine-27aae603817d2fed69099184b56f04c3d29fe2c6.tar.gz go-tangerine-27aae603817d2fed69099184b56f04c3d29fe2c6.tar.bz2 go-tangerine-27aae603817d2fed69099184b56f04c3d29fe2c6.tar.lz go-tangerine-27aae603817d2fed69099184b56f04c3d29fe2c6.tar.xz go-tangerine-27aae603817d2fed69099184b56f04c3d29fe2c6.tar.zst go-tangerine-27aae603817d2fed69099184b56f04c3d29fe2c6.zip |
Merge branch 'hotfix/2' into develop
-rw-r--r-- | ethchain/block.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ethchain/block.go b/ethchain/block.go index bdb243286..24ff5a32f 100644 --- a/ethchain/block.go +++ b/ethchain/block.go @@ -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 { |