anchor.diff:              end
       end.
   
  -first_port([Link|_Links]) when is_port(Link) -> Link;
  +first_port([Port|_Links]) when is_port(Port) -> Port;
   first_port([_|Links]) -> first_port(Links);
   first_port([]) -> undefined.
   
  
positive.code: is_leader(Node) ->
      rpc:call(Node, riak_repl_leader, leader_node, []) == Node.
  
  riak_nodes(Node) ->    
      rpc:call(Node, riak_core_node_watcher, nodes, [riak_kv]).
  
  filter_badrpc({badrpc, _}) -> false;
  filter_badrpc(_) -> true.
  
  unknown() ->
      {unknown, "Unexpected return from process_info", []}.
  
  
negative.code: check_repl(Node) ->
      case is_leader(Node) of
          true ->
              Pids = repl_pids(Node),
              [check_repl_pid(Node, Pid) || Pid <- Pids];
          false ->
              []
      end.
  
  repl_pids(Node) ->
      repl_server_pids(Node) ++ repl_client_pids(Node).
  
  repl_server_pids(Node) ->
      [Pid || {Pid, _, _} <- rpc:call(Node, riak_repl_console, server_stats_rpc, [])].
  
  repl_client_pids(Node) ->
      [Pid || {Pid, _, _} <- rpc:call(Node, riak_repl_console, client_stats_rpc, [])].
  
  check_repl_pid(Node, Pid) ->
      case rpc:call(Node, rpc, pinfo, [Pid, links]) of
          undefined ->
              unknown;
          {links, Links} ->
              Port = first_port(Links),
              case Port of
                  undefined ->
  