anchor.diff:        end, empty),
       erlang:process_flag(trap_exit, true),
       {ok, _} = timer:send_interval(?HEARTBEAT_INTERVAL, send_heartbeat),
  +
  +    NewPeers = [node()],
  +
       case ns_node_disco:nodes_wanted() of
           [N] = P when N == node() ->
               ?log_info("I'm the only node, so I'm the master.", []),
  -            {ok, master, start_master(#state{last_heard=now(), peers=P})};
  +            %% since we're the only node in the cluster we can operate in new
  +            %% mode
  +            {ok, master, start_master(#state{last_heard=now(),
  +                                             peers=P,
  +                                             new_peers=NewPeers,
  +                                             mode=normal})};
           Peers when is_list(Peers) ->
               case lists:member(node(), Peers) of
                   false ->
                       %% We're a worker, but don't know who the master is yet
                       ?log_info("Starting as worker. Peers: ~p", [Peers]),
  -                    {ok, worker, #state{last_heard=now()}};
  +                    {ok, worker, #state{last_heard=now(),
  +                                        new_peers=NewPeers}};
                   true ->
                       %% We're a candidate
                       ?log_info("Starting as candidate. Peers: ~p", [Peers]),
  -                    {ok, candidate, #state{last_heard=now(), peers=Peers}}
  +                    {ok, candidate, #state{last_heard=now(),
  +                                           peers=Peers,
  +                                           new_peers=NewPeers}}
               end
       end.
   
  
positive.code: %% @private
  %% @doc Send an heartbeat to a list of nodes, except this one.
  send_heartbeat(Nodes, StateName, StateData) ->
      Args = {heartbeat, node(), StateName,
              [{peers, StateData#state.peers}]},
      try
          misc:parallel_map(
            fun (Node) ->
  
negative.code:             ?log_info("Master got candidate heartbeat from node ~p which is "
                        "not in peers ~p", [Node, Peers])
      end,
      {next_state, master, S#state{last_heard=now()}};
  
  master(Event, State) ->
      ?log_info("Got event ~p as master with state ~p", [Event, State]),
      {next_state, master, State}.
  
  
  worker({heartbeat, NodeInfo, master, Data}, State) ->
      Node = node_info_to_node(NodeInfo),
      S = update_new_peers(State, NodeInfo, Data),
  
      case S#state.master of
          Node ->
              {next_state, worker, S#state{last_heard=now()}};
          N ->
              ?log_info("Saw master change from ~p to ~p", [N, Node]),
              {next_state, worker, S#state{last_heard=now(), master=Node}}
      end;
  
  worker(Event, State) ->
  