diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-10-15 15:58:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-15 15:58:54 +0800 |
commit | b19b7c39ac1074592c0aea1dc2b282d08d9a42b0 (patch) | |
tree | df09a9e41909dbf281e637af3240803dfd2ee9e5 | |
parent | 9276c4e163b2cb0a9f9438dbfa28444afea081db (diff) | |
parent | 2cd7a0395dd8813867884bced1b01663165ea1d4 (diff) | |
download | go-tangerine-b19b7c39ac1074592c0aea1dc2b282d08d9a42b0.tar go-tangerine-b19b7c39ac1074592c0aea1dc2b282d08d9a42b0.tar.gz go-tangerine-b19b7c39ac1074592c0aea1dc2b282d08d9a42b0.tar.bz2 go-tangerine-b19b7c39ac1074592c0aea1dc2b282d08d9a42b0.tar.lz go-tangerine-b19b7c39ac1074592c0aea1dc2b282d08d9a42b0.tar.xz go-tangerine-b19b7c39ac1074592c0aea1dc2b282d08d9a42b0.tar.zst go-tangerine-b19b7c39ac1074592c0aea1dc2b282d08d9a42b0.zip |
Merge pull request #3142 from fjl/trie-sync-fix
trie: fix regression that linked all downloaded nodes together
-rw-r--r-- | trie/sync.go | 2 |
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{ |