anchor.diff:              ?info("New node: ~p", [SenderNode]),
               try
                   erlang:monitor_node(SenderNode, true),
  -                NewInitNodes = [SenderNode | lists:delete(SenderNode, InitNodes)],
  +                NewInitNodes = add_node_to_list(SenderNode, InitNodes),
                   gen_server:cast({?NODE_MANAGER_NAME, SenderNode},
                       {heartbeat_ok, State#cm_state.state_num}),
                   State#cm_state{uninitialized_nodes = NewInitNodes}
  
positive.code:         {ok, undefined} ->
              {ok, {Nodes, StateNum}};
          _ -> {error, invalid_worker_num}
      end.
negative.code:         state_num = NewStateNum}.
  
  %%--------------------------------------------------------------------
  %% @doc
  %% Get node that can be used by new nodes to synchronize with
  %% (i. e. attach to mnesia cluster). This node should be one of active
  %% nodes of existing cluster, or if there isn't any, the first of nodes
  %% that are initializing.
  %%
  %% In some cases synchronization requires waiting for this node to finish
  %% initialization process. It is up to caller to wait and ensure that he can
  %% safely synchronize.
  %% @end
  %%--------------------------------------------------------------------
  -spec get_node_to_sync(#cm_state{}) -> {ok, node()} | {error, term()}.
  get_node_to_sync(#cm_state{nodes = [], uninitialized_nodes = []}) ->
      {error, no_nodes_connected};
  get_node_to_sync(#cm_state{nodes = [], uninitialized_nodes = [FirstInitNode | _]}) ->
      {ok, FirstInitNode};
  get_node_to_sync(#cm_state{nodes = [FirstNode | _]}) ->
      {ok, FirstNode}.
  
  %%--------------------------------------------------------------------
  %% @private
  %% @doc
  %% Handles healthcheck request
  