Skip to content

Commit

Permalink
Merge pull request ethereum#3142 from fjl/trie-sync-fix
Browse files Browse the repository at this point in the history
trie: fix regression that linked all downloaded nodes together
  • Loading branch information
karalabe authored Oct 15, 2016
2 parents 9276c4e + 2cd7a03 commit b19b7c3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions trie/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit b19b7c3

Please sign in to comment.