aboutsummaryrefslogtreecommitdiffstats
path: root/trie/hashnode.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-02-11 18:40:12 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-02-11 18:40:12 +0800
commitcfddb7f3cd3b8cecb1e59412ce4db5769f6c8007 (patch)
treeab28c518bd1b78f6b8ac8b241951ad161cb268a9 /trie/hashnode.go
parent21fd31dad8bc6e0291ca405314b516670333c707 (diff)
parentc6af5f0a275608ea6c797ef826e6090885f24eac (diff)
downloadgo-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.gz
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.bz2
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.lz
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.xz
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.zst
go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.zip
Merge branch 'develop' into jsonrpc
Conflicts: rpc/ws/server.go
Diffstat (limited to 'trie/hashnode.go')
-rw-r--r--trie/hashnode.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/trie/hashnode.go b/trie/hashnode.go
index 40ccd54c3..e46628368 100644
--- a/trie/hashnode.go
+++ b/trie/hashnode.go
@@ -1,11 +1,14 @@
package trie
+import "github.com/ethereum/go-ethereum/ethutil"
+
type HashNode struct {
- key []byte
+ key []byte
+ trie *Trie
}
-func NewHash(key []byte) *HashNode {
- return &HashNode{key}
+func NewHash(key []byte, trie *Trie) *HashNode {
+ return &HashNode{key, trie}
}
func (self *HashNode) RlpData() interface{} {
@@ -17,6 +20,6 @@ func (self *HashNode) Hash() interface{} {
}
// These methods will never be called but we have to satisfy Node interface
-func (self *HashNode) Value() Node { return nil }
-func (self *HashNode) Dirty() bool { return true }
-func (self *HashNode) Copy() Node { return self }
+func (self *HashNode) Value() Node { return nil }
+func (self *HashNode) Dirty() bool { return true }
+func (self *HashNode) Copy(t *Trie) Node { return NewHash(ethutil.CopyBytes(self.key), t) }