anchor.diff:      etorrent_torrent:decrease_not_fetched(Id),
       ok.
   
  -%%--------------------------------------------------------------------
  -%% Function: find_chunked_chunks(Id, iterator_result()) -> none | PieceNum
  -%% Description: Search an iterator for a chunked piece.
  -%%--------------------------------------------------------------------
  +%% @doc Search for piece chunks to download from a peer
  +%%   We are given an iterator of the pieces the peer has. We search the
  +%%   the iterator for a pieces we have already chunked and are downloading.
  +%%   If found, return the #chunk{} object. Otherwise return 'none'
  +%% @end
  +-spec find_chunked_chunks(pos_integer(), term(), A) -> A | [#chunk{}].
   find_chunked_chunks(_Id, none, Res) -> Res;
   find_chunked_chunks(Id, {Pn, Next}, Res) ->
       case etorrent_piece_mgr:is_chunked(Id, Pn) of
  
positive.code:     Shuffled = etorrent_utils:shuffle(Remaining),
      {endgame, lists:sublist(Shuffled, N)}.
  
  -spec pick_chunks_endgame(integer(), gb_set(), integer(), X) -> X | {endgame, [#chunk{}]}.
  pick_chunks_endgame(Id, Set, Remaining, Ret) ->
      case etorrent_torrent:is_endgame(Id) of
  
negative.code:             case ets:lookup(?TAB, {Id, Pn, not_fetched}) of
                  [] ->
                      find_chunked_chunks(Id, gb_sets:next(Next), found_chunked);
                  Objects ->
                      Objects
              end;
          false ->
              find_chunked_chunks(Id, gb_sets:next(Next), Res)
  