aboutsummaryrefslogtreecommitdiffstats
path: root/ptrie
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-21 01:20:04 +0800
committerobscuren <geffobscura@gmail.com>2014-11-21 01:20:04 +0800
commit9b8a12b4b53f319f6422a43e43b2274a337d7fec (patch)
tree994f29a76d81c7c1984d856a27813142089c3451 /ptrie
parent12f1aea38d6f9dd9748a95b2d9ea813ae16277a7 (diff)
downloaddexon-9b8a12b4b53f319f6422a43e43b2274a337d7fec.tar
dexon-9b8a12b4b53f319f6422a43e43b2274a337d7fec.tar.gz
dexon-9b8a12b4b53f319f6422a43e43b2274a337d7fec.tar.bz2
dexon-9b8a12b4b53f319f6422a43e43b2274a337d7fec.tar.lz
dexon-9b8a12b4b53f319f6422a43e43b2274a337d7fec.tar.xz
dexon-9b8a12b4b53f319f6422a43e43b2274a337d7fec.tar.zst
dexon-9b8a12b4b53f319f6422a43e43b2274a337d7fec.zip
Removed naively casting to bytes
Diffstat (limited to 'ptrie')
-rw-r--r--ptrie/trie.go16
1 files changed, 7 insertions, 9 deletions
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(""))
}