aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--trie/sync.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/trie/sync.go b/trie/sync.go
index 3de758536..400dff903 100644
--- a/trie/sync.go
+++ b/trie/sync.go
@@ -213,11 +213,13 @@ func (s *TrieSync) children(req *request) ([]*request, error) {
switch node := (*req.object).(type) {
case *shortNode:
+ node = node.copy() // Prevents linking all downloaded nodes together.
children = []child{{
node: &node.Val,
depth: req.depth + len(node.Key),
}}
case *fullNode:
+ node = node.copy()
for i := 0; i < 17; i++ {
if node.Children[i] != nil {
children = append(children, child{