Commit 9b8a12b4 authored by obscuren's avatar obscuren

Removed naively casting to bytes

parent 12f1aea3
......@@ -53,15 +53,13 @@ func (self *Trie) Root() []byte { return self.Hash() }
func (self *Trie) Hash() []byte {
var hash []byte
if self.root != nil {
hash = self.root.Hash().([]byte)
/*
t := self.root.Hash()
if byts, ok := t.([]byte); ok {
hash = byts
} else {
hash = crypto.Sha3(ethutil.Encode(self.root.RlpData()))
}
*/
//hash = self.root.Hash().([]byte)
t := self.root.Hash()
if byts, ok := t.([]byte); ok {
hash = byts
} else {
hash = crypto.Sha3(ethutil.Encode(self.root.RlpData()))
}
} else {
hash = crypto.Sha3(ethutil.Encode(""))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment