|
|
@ -53,15 +53,13 @@ func (self *Trie) Root() []byte { return self.Hash() } |
|
|
|
func (self *Trie) Hash() []byte { |
|
|
|
func (self *Trie) Hash() []byte { |
|
|
|
var hash []byte |
|
|
|
var hash []byte |
|
|
|
if self.root != nil { |
|
|
|
if self.root != nil { |
|
|
|
hash = self.root.Hash().([]byte) |
|
|
|
//hash = self.root.Hash().([]byte)
|
|
|
|
/* |
|
|
|
t := self.root.Hash() |
|
|
|
t := self.root.Hash() |
|
|
|
if byts, ok := t.([]byte); ok { |
|
|
|
if byts, ok := t.([]byte); ok { |
|
|
|
hash = byts |
|
|
|
hash = byts |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
hash = crypto.Sha3(ethutil.Encode(self.root.RlpData())) |
|
|
|
hash = crypto.Sha3(ethutil.Encode(self.root.RlpData())) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
hash = crypto.Sha3(ethutil.Encode("")) |
|
|
|
hash = crypto.Sha3(ethutil.Encode("")) |
|
|
|
} |
|
|
|
} |
|
|
|