diff --git a/x/merkledb/proof.go b/x/merkledb/proof.go index f750158d4c11..c94a68f7db5b 100644 --- a/x/merkledb/proof.go +++ b/x/merkledb/proof.go @@ -840,9 +840,9 @@ func addPathInfo( if existingChild, ok := n.children[index]; ok { compressedKey = existingChild.compressedKey } - childPath := key.Extend(ToToken(index, t.tokenSize), compressedKey) - if (shouldInsertLeftChildren && childPath.Less(insertChildrenLessThan.Value())) || - (shouldInsertRightChildren && childPath.Greater(insertChildrenGreaterThan.Value())) { + childKey := key.Extend(ToToken(index, t.tokenSize), compressedKey) + if (shouldInsertLeftChildren && childKey.Less(insertChildrenLessThan.Value())) || + (shouldInsertRightChildren && childKey.Greater(insertChildrenGreaterThan.Value())) { // We didn't set the other values on the child entry, but it doesn't matter. // We only need the IDs to be correct so that the calculated hash is correct. n.setChildEntry(