diff --git a/internal/neofs/tree.go b/internal/neofs/tree.go index 9e84a771f..c985c703d 100644 --- a/internal/neofs/tree.go +++ b/internal/neofs/tree.go @@ -60,8 +60,6 @@ const ( maxGetSubTreeDepth = 10 // current limit on storage node side ) -var emptyOID oid.ID - // NewTreeClient creates instance of TreeClient using provided address and create grpc connection. func NewTreeClient(addr string, key *keys.PrivateKey) (*TreeClient, error) { conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) @@ -309,6 +307,8 @@ func (c *TreeClient) getSubTreeLatestVersions(ctx context.Context, cnrID *cid.ID return nil, err } + var emptyOID oid.ID + latestVersions := make(map[string]*TreeNode, len(subTree)) for _, node := range subTree { treeNode, err := newTreeNode(node)