anchor.diff:  init([OurPeerId]) ->
       process_flag(trap_exit, true),
       _Tref = timer:send_interval(?CHECK_TIME, self(), cleanup_table),
  -    _Tid = ets:new(etorrent_bad_peer, [set, protected, named_table,
  +    _Tid = ets:new(etorrent_bad_peer, [protected, named_table,
                                          {keypos, #bad_peer.ipport}]),
       {ok, #state{ our_peer_id = OurPeerId }}.
   
  
positive.code:             % Possible peer. Check it.
              case is_bad_peer(IP, Port) of
                  true ->
                      fill_peers(S#state{available_peers = R});
                  false ->
                      case etorrent_peer:connected(IP, Port, TorrentId) of
                          true ->
                              fill_peers(S#state{available_peers = R});
                          false ->
                              error_logger:info_report([spawning, {ip, IP},
                                                        {port, Port}, {tid, TorrentId}]),
                              spawn_new_peer(IP, Port, TorrentId,
                                             S#state{available_peers = R})
                      end
              end
      end.
  
  %%--------------------------------------------------------------------
  %% Function: spawn_new_peer(IP, Port, S) -> S
  %%  Args:   IP ::= ip_address()
  %%          Port ::= integer() (16-bit)
  %%          S :: #state()
  %% Description: Attempt to spawn the peer at IP/Port. Returns modified state.
  %%--------------------------------------------------------------------
  spawn_new_peer(IP, Port, TorrentId, S) ->
      case etorrent_peer:connected(IP, Port, TorrentId) of
          true ->
              fill_peers(S);
          false ->
              {atomic, [TM]} = etorrent_tracking_map:select(TorrentId),
              case etorrent_counters:obtain_peer_slot() of
                  ok ->
                      try
                          {ok, Pid} = etorrent_t_sup:add_peer(
                                        TM#tracking_map.supervisor_pid,
                                        S#state.our_peer_id,
                                        TM#tracking_map.info_hash,
                                        TorrentId,
                                        {IP, Port}),
                          ok = etorrent_t_peer_recv:connect(Pid, IP, Port)
                      catch
                          throw:_ -> etorrent_counters:release_peer_slot();
                          exit:_ ->  etorrent_counters:release_peer_slot()
                      end,
                      fill_peers(S);
                  full ->
                      S
              end
      end.
  
  
negative.code: 
  start_new_peers(IPList, State) ->
      %% Update the PeerList with the new incoming peers
      %% XXX:
      %%   the usort is potentially a bad idea here. It will sort the list
      %%   and thus mostly take IP addresses in a specific order. This is
      %%   a bad idea for various reasons.
      %%
      %%   A nice change would be to do duplicate removal the right way
      %%   on the unsorted list.
      PeerList = lists:usort(IPList ++ State#state.available_peers),
      S = State#state { available_peers = PeerList},
  
      %% Replenish the connected peers.
      fill_peers(S).
  
  fill_peers(S) ->
      case S#state.available_peers of
          [] ->
  