anchor.diff:  %% Convert node info to node.
   -spec node_info_to_node(node_info()) -> node().
   node_info_to_node({_Version, Node}) ->
  -    Node;
  -node_info_to_node(Node) ->
       Node.
   
   %% Determine whether some node is of higher priority than ourselves.
  --spec higher_priority_node(node_info(), #state{}) -> boolean().
  -higher_priority_node(NodeInfo, #state{mode=Mode} = StateData) ->
  -    Self = node_info(StateData),
  -    higher_priority_node(Self, NodeInfo, Mode).
  -
  --spec higher_priority_node(node_info(), node_info(), operation_mode()) ->
  -                                  boolean().
  -higher_priority_node(Self, NodeInfo, Mode) ->
  -    Node = node_info_to_node(NodeInfo),
  -
  -    case Mode =:= normal andalso not is_atom(NodeInfo) of
  -        true ->
  -            {SelfVersion, SelfNode} = Self,
  -            {Version, _} = NodeInfo,
  -
  -            if
  -                Version > SelfVersion ->
  -                    true;
  -                Version =:= SelfVersion ->
  -                    Node < SelfNode;
  -                true ->
  -                    false
  -            end;
  -        false ->
  -            case is_atom(NodeInfo) of
  -                false ->
  -                    ?log_warning("Got new-style heartbeat from ~p "
  -                                 "node when in compatible mode", [Node]);
  -                true ->
  -                    ok
  -            end,
  -            Node < node_info_to_node(Self)
  +-spec higher_priority_node(node_info()) -> boolean().
  +higher_priority_node(NodeInfo) ->
  +    Self = node_info(),
  +    higher_priority_node(Self, NodeInfo).
  +
  +higher_priority_node({SelfVersion, SelfNode},
  +                     {Version, Node}) ->
  +    if
  +        Version > SelfVersion ->
  +            true;
  +        Version =:= SelfVersion ->
  +            Node < SelfNode;
  +        true ->
  +            false
       end.
   
  +%% true iff we need to take over mastership of given node
  +-spec strongly_lower_priority_node(node_info()) -> boolean().
  +strongly_lower_priority_node(NodeInfo) ->
  +    Self = node_info(),
  +    strongly_lower_priority_node(Self, NodeInfo).
  +
  +strongly_lower_priority_node({SelfVersion, _SelfNode},
  +                              {Version, _Node}) ->
  +    (Version < SelfVersion).
  +
   -ifdef(EUNIT).
   
   priority_test() ->
  -    ?assertEqual(true,
  -                 higher_priority_node('ns_2@192.168.1.1',
  -                                      'ns_1@192.168.1.1',
  -                                      compatible)),
  -
  -    ?assertEqual(false,
  -                 higher_priority_node({misc:parse_version("1.7.1"),
  -                                       'ns_1@192.168.1.1'},
  -                                      'ns_2@192.168.1.1',
  -                                      normal)),
  -    ?assertEqual(true,
  -                 higher_priority_node({misc:parse_version("1.7.1"),
  -                                       'ns_2@192.168.1.1'},
  -                                      'ns_1@192.168.1.1',
  -                                      normal)),
  -
       ?assertEqual(true,
                    higher_priority_node({misc:parse_version("1.7.1"),
                                          'ns_1@192.168.1.1'},
                                         {misc:parse_version("2.0"),
  -                                       'ns_2@192.168.1.1'},
  -                                      normal)),
  +                                       'ns_2@192.168.1.1'})),
       ?assertEqual(true,
                    higher_priority_node({misc:parse_version("1.7.1"),
                                          'ns_2@192.168.1.1'},
                                         {misc:parse_version("2.0"),
  -                                       'ns_1@192.168.1.1'},
  -                                      normal)),
  +                                       'ns_1@192.168.1.1'})),
       ?assertEqual(false,
                    higher_priority_node({misc:parse_version("2.0"),
                                          'ns_1@192.168.1.1'},
                                         {misc:parse_version("1.7.2"),
  -                                       'ns_0@192.168.1.1'},
  -                                      normal)),
  -    ?assertEqual(true,
  -                 higher_priority_node({misc:parse_version("2.0"),
  -                                       'ns_2@192.168.1.1'},
  -                                      {misc:parse_version("2.0"),
  -                                       'ns_1@192.168.1.1'},
  -                                      normal)).
  +                                       'ns_0@192.168.1.1'})),
  +    ?assertEqual(true, higher_priority_node({misc:parse_version("2.0"),
  +                                             'ns_2@192.168.1.1'},
  +                                            {misc:parse_version("2.0"),
  +                                             'ns_1@192.168.1.1'})).
   
   -endif.
  
positive.code:                       "a master, so I'm taking over.", []),
              {ok, Pid} = mb_master_sup:start_link(),
              {next_state, master,
               choose_mode(StateData#state{child=Pid, master=node()})};
          false ->
              {next_state, candidate, choose_mode(StateData)}
      end;
  
  handle_info(send_heartbeat, master, StateData) ->
  
negative.code: -define(HEARTBEAT_INTERVAL, 2000).
  -define(TIMEOUT, ?HEARTBEAT_INTERVAL * 5000). % in microseconds
  
  -type node_info() :: {version(), node()}.
  
  -record(state, {child :: pid(),
                  master :: node(),
                  peers :: [node()],
                  last_heard :: {integer(), integer(), integer()}}).
  
  
  %% API
  