diff options
Diffstat (limited to 'ptrie/fullnode.go')
-rw-r--r-- | ptrie/fullnode.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ptrie/fullnode.go b/ptrie/fullnode.go index eaa4611b6..7a7f7d22d 100644 --- a/ptrie/fullnode.go +++ b/ptrie/fullnode.go @@ -18,7 +18,14 @@ func (self *FullNode) Branches() []Node { return self.nodes[:16] } -func (self *FullNode) Copy() Node { return self } +func (self *FullNode) Copy() Node { + nnode := NewFullNode(self.trie) + for i, node := range self.nodes { + nnode.nodes[i] = node + } + + return nnode +} // Returns the length of non-nil nodes func (self *FullNode) Len() (amount int) { |