Skip to content

Commit

Permalink
fix traverse order in tree iterator (cosmos#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang authored and ankurdotb committed Feb 28, 2023
1 parent 73e787d commit f812636
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,10 @@ func (iter *NodeIterator) Next(isSkipped bool) {
iter.err = err
return
}
iter.nodesToVisit = append(iter.nodesToVisit, leftNode)
rightNode, err := iter.ndb.GetNode(node.rightHash)
if err != nil {
iter.err = err
return
}
iter.nodesToVisit = append(iter.nodesToVisit, rightNode)
iter.nodesToVisit = append(iter.nodesToVisit, rightNode, leftNode)
}

0 comments on commit f812636

Please sign in to comment.