anchor.diff:  %% @private
   %% @doc Send an heartbeat to a list of nodes, except this one.
   send_heartbeat(Nodes, StateName, StateData) ->
  -    NodeInfo = node_info(StateData),
  +    NodeInfo = node_info(),
   
       Args = {heartbeat, NodeInfo, StateName,
               [{peers, StateData#state.peers},
  
positive.code:     end,
      State#state{child = undefined}.
  
  %% Checks state and adjusts execution mode when it's possible.
  -spec choose_mode(#state{}) -> #state{}.
  choose_mode(#state{peers=Peers,
                     new_peers=NPeers,
                     mode=CurrentMode} = StateData) ->
      Mode =
          case Peers of
              %% we're the only node, thus the new mode can be used
              [N] when N =:= node() ->
                  normal;
              _ ->
                  %% both Peers and NPeers are sorted
                  case NPeers =:= Peers of
                      true -> normal;
                      false -> compatible
                  end
          end,
  
      case CurrentMode =/= Mode of
          true ->
              ?log_info("Switching from ~p to ~p mode",
                        [CurrentMode, Mode]);
          false ->
              ok
      end,
  
      StateData#state{mode=Mode}.
  
  %% Updates an information about new peers. Switches mode if necessary.
  update_new_peers(#state{peers=Peers, new_peers=NPeers0} = StateData,
                   NodeInfo, HeartbeatData) ->
      Node = node_info_to_node(NodeInfo),
  
      case lists:member(Node, Peers) of
          true ->
              NPeers1 =
                  case proplists:get_value(versioning, HeartbeatData, false) of
                      true ->
                          ordsets:add_element(node_info_to_node(NodeInfo),
                                              NPeers0);
                      false ->
                          NPeers0
                  end,
  
              case NPeers0 =:= NPeers1 of
                  false ->
                      ?log_info("Got new peer supporting versioning: ~p", [Node]);
                  true ->
                      ok
              end,
  
              choose_mode(StateData#state{new_peers=NPeers1});
          false ->
              ?log_info("Got heartbeat from unknown node ~p~n", [Node]),
              StateData
      end.
  
  -spec node_info(#state{}) -> node_info().
  node_info(#state{mode=compatible}) ->
      node();
  node_info(#state{mode=normal}) ->
      RawVersion = ns_info:version(ns_server),
      Version = misc:parse_version(RawVersion),
      {Version, node()}.
  
negative.code:                       "a master, so I'm taking over.", []),
              {ok, Pid} = mb_master_sup:start_link(),
              {next_state, master,
               StateData#state{child=Pid, master=node()}};
          false ->
              {next_state, candidate, StateData}
      end;
  
  handle_info(send_heartbeat, master, StateData) ->
  