Fixed a copy issue in the trie which could cause a consensus failure
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user