From 9b8a12b4b53f319f6422a43e43b2274a337d7fec Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 20 Nov 2014 18:20:04 +0100 Subject: Removed naively casting to bytes --- ptrie/trie.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'ptrie') diff --git a/ptrie/trie.go b/ptrie/trie.go index 4b0f20d8c..7701966e5 100644 --- a/ptrie/trie.go +++ b/ptrie/trie.go @@ -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("")) } -- cgit