mirror of
https://github.com/arnaucube/go-ethereum.git
synced 2026-02-28 14:06:45 +01:00
Fixed casting issue
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user