aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-21 04:04:47 +0800
committerobscuren <geffobscura@gmail.com>2014-05-21 04:04:47 +0800
commit3b38df085ebebd68f1bf76c11c8b87ae75f29fe2 (patch)
tree51ebdf31ab7be376d226a64d4156967c826fe7c6 /ethchain
parente837c9ab3fc94979dd79df9b70a3e7fda74263b9 (diff)
downloadgo-tangerine-3b38df085ebebd68f1bf76c11c8b87ae75f29fe2.tar
go-tangerine-3b38df085ebebd68f1bf76c11c8b87ae75f29fe2.tar.gz
go-tangerine-3b38df085ebebd68f1bf76c11c8b87ae75f29fe2.tar.bz2
go-tangerine-3b38df085ebebd68f1bf76c11c8b87ae75f29fe2.tar.lz
go-tangerine-3b38df085ebebd68f1bf76c11c8b87ae75f29fe2.tar.xz
go-tangerine-3b38df085ebebd68f1bf76c11c8b87ae75f29fe2.tar.zst
go-tangerine-3b38df085ebebd68f1bf76c11c8b87ae75f29fe2.zip
Fixed casting issue
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/block.go10
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 {