anchor.diff:  
   -record(state, { monitoring }).
   -define(SERVER, ?MODULE).
  +-define(TAB, etorrent_piece_tbl).
   -ignore_xref([{'start_link', 0}]).
   %%====================================================================
   %% API
  
positive.code: handle_call({add_pieces, Id, Pieces}, _From, S) ->
      lists:foreach(
        fun({PN, Hash, Files, State}) ->
                ets:insert(etorrent_piece_tbl,
                           #piece { idpn = {Id, PN},
                                    id = Id,
                                    piece_number = PN,
  
negative.code: 
  find_new_worker(_Id, none) -> none;
  find_new_worker(Id, {PN, Nxt}) ->
      case ets:lookup(?TAB, {Id, PN}) of
          [] ->
              find_new_worker(Id, gb_sets:next(Nxt));
          [#piece{ state = not_fetched } = P] -> P;
          [_P] -> find_new_worker(Id, gb_sets:next(Nxt))
      end.
  
  %% (TODO: Somewhat expensive, but we start here) Chunked pieces
  -spec chunked_pieces(pos_integer()) -> [pos_integer()].
  chunked_pieces(Id) ->
      Objects = ets:match_object(?TAB, #piece { idpn = {Id, '_'}, state = chunked, _ = '_' }),
      [I || #piece {idpn = {I, _}} <- Objects].
  
  %% Returns true if the piece in question is chunked.
  -spec is_chunked(integer(), integer()) -> boolean().
  is_chunked(Id, Pn) ->
      [P] = ets:lookup(?TAB, {Id, Pn}),
      P#piece.state == chunked.
  
  %%====================================================================
  