aboutsummaryrefslogtreecommitdiffstats
path: root/trie/node.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-03 11:58:34 +0800
committerobscuren <geffobscura@gmail.com>2015-02-03 11:58:34 +0800
commit3c7181d28f1f24aaea2da5cce664ffac52f369df (patch)
tree36e229ec95e89287e6d1add6ab587a90f8960041 /trie/node.go
parent6fecb150d6f2bb36d3f1b7b9095cac428df2ce5a (diff)
downloaddexon-3c7181d28f1f24aaea2da5cce664ffac52f369df.tar
dexon-3c7181d28f1f24aaea2da5cce664ffac52f369df.tar.gz
dexon-3c7181d28f1f24aaea2da5cce664ffac52f369df.tar.bz2
dexon-3c7181d28f1f24aaea2da5cce664ffac52f369df.tar.lz
dexon-3c7181d28f1f24aaea2da5cce664ffac52f369df.tar.xz
dexon-3c7181d28f1f24aaea2da5cce664ffac52f369df.tar.zst
dexon-3c7181d28f1f24aaea2da5cce664ffac52f369df.zip
Fixed a copy issue in the trie which could cause a consensus failure
Diffstat (limited to 'trie/node.go')
-rw-r--r--trie/node.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/trie/node.go b/trie/node.go
index f28f24771..0d8a7cff9 100644
--- a/trie/node.go
+++ b/trie/node.go
@@ -6,7 +6,7 @@ var indices = []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b
type Node interface {
Value() Node
- Copy() Node // All nodes, for now, return them self
+ Copy(*Trie) Node // All nodes, for now, return them self
Dirty() bool
fstring(string) string
Hash() interface{}
@@ -18,7 +18,11 @@ func (self *ValueNode) String() string { return self.fstring("") }
func (self *FullNode) String() string { return self.fstring("") }
func (self *ShortNode) String() string { return self.fstring("") }
func (self *ValueNode) fstring(ind string) string { return fmt.Sprintf("%x ", self.data) }
-func (self *HashNode) fstring(ind string) string { return fmt.Sprintf("< %x > ", self.key) }
+
+//func (self *HashNode) fstring(ind string) string { return fmt.Sprintf("< %x > ", self.key) }
+func (self *HashNode) fstring(ind string) string {
+ return fmt.Sprintf("%v", self.trie.trans(self))
+}
// Full node
func (self *FullNode) fstring(ind string) string {