anchor.diff:              {value, Snubbed, St} = etorrent_peer_states:get_state(Id, Pid),
               case lookup_info(Seeding, Id, Pid) of
                   none -> build_rechoke_info(Seeding, Next);
  -                {State, R} -> [#rechoke_info {
  -                                    pid = Pid,
  -                                    peer_state = PeerState,
  -                                    state = State,
  -                                    rate = R,
  -                                    r_interest_state = proplists:get_value(interest_state, St),
  -                                    r_choke_state    = proplists:get_value(choke_state, St),
  -                                    l_choke          = proplists:get_value(local_choke, St),
  -                                    peer_snubs = Snubbed } |
  -                            build_rechoke_info(Seeding, Next)]
  +                {State, R} ->
  +                    [#rechoke_info {
  +                        pid = Pid,
  +                        peer_state = PeerState,
  +                        state = State,
  +                        rate = R,
  +                        r_interest_state =
  +                            proplists:get_value(interest_state, St),
  +                        r_choke_state    = proplists:get_value(choke_state, St),
  +                        l_choke          = proplists:get_value(local_choke, St),
  +                        peer_snubs = Snubbed } |
  +                     build_rechoke_info(Seeding, Next)]
               end
       end.
   
  +%% Move the chain (that is, circular buffer) so there is a new peer
  +%% who is the one getting optimistically unchoked.
   advance_optimistic_unchoke(S) ->
       NewChain = move_cyclic_chain(S#state.opt_unchoke_chain),
       case NewChain of
  
positive.code:                     not_found -> true;
                      {peer_info, _Kind, Id} ->
                          PL = etorrent_peer_states:get_pids_interest(Id, Pid),
  			%% Peers not interested in us are skipped. Optimistically unchoking these
  			%% would not help as they would request nothing. Peers already not choking
  			%% us are in the valuation game, so they are also skipped.
  			( proplists:get_value(interested, PL) == not_interested
  			  orelse proplists:get_value(choking, PL) == unchoked )
                  end
          end,
      {Front, Back} = lists:splitwith(F, Chain),
      %% Advance chain
      Back ++ Front.
  
  insert_new_peer_into_chain(Pid, []) ->
  
negative.code: %%  - Those we are Seeding to
  %% But in the process, skip over any peer which is unintersting
  split_preferred_peers([], L, S) -> {L, S};
  split_preferred_peers(
    [#rechoke_info { peer_state = PeerState, r_interest_state = RemoteInterest,
                     state = State, peer_snubs = Snubbed } = P | Next],
    WeLeech, WeSeed) ->
      case PeerState == seeding orelse RemoteInterest == not_interested of
          true ->
              %% Peer is seeding a torrent or we are connected to a
              %% peer not interested in downloading anything. Unchoking
              %% him would not help anything, skip.
              %% NOTE: In the case he is not_interested, we will unchoke
              %% him anyway at a later phase because we can then start
              %% serving him as soon as possible if his state changes!
              split_preferred_peers(Next, WeLeech, WeSeed);
          false when State =:= seeding ->
              %% We are seeding this torrent, so throw the Peer into the
              %% group of peers we seed to.
              split_preferred_peers(Next, WeLeech, [P | WeSeed]);
          false when Snubbed =:= true ->
              %% The peer has not sent us anything for 30 seconds, so we
              %% regard the peer as snubbing us. Thus, unchoking the peer would
              %% be rather insane. We'd rather use the slot for someone else.
              split_preferred_peers(Next, WeLeech, WeSeed);
          false ->
              %% If none of the other cases match, we have a Peer we are leeching
              %% from, so throw the peer into the leecher set.
              split_preferred_peers(Next, [P | WeLeech], WeSeed)
      end.
  
  