anchor.diff:      {atomic, _} = mnesia:transaction(F),
       ok.
   
  -%%--------------------------------------------------------------------
  -%% Function: is_ready_for_checking(Id) -> bool()
  -%% Description: Attempt to mark the torrent for checking. If this
  -%%   succeeds, returns true, else false
  -%%--------------------------------------------------------------------
  +% @doc Attempt to mark the torrent for checking.
  +%  <p>If this succeeds, returns true, else false</p>
  +% @end
  +-spec is_ready_for_checking(integer()) -> boolean().
   is_ready_for_checking(Id) ->
       F = fun () ->
                   Q = qlc:q([TM || TM <- mnesia:table(tracking_map),
  
positive.code:     ok.
  
  %%====================================================================
  %% Internal functions
  %%====================================================================
  
  alter_map(TM, What) ->
      case What of
          {infohash, IH} ->
  
negative.code: 
  -define(SERVER, ?MODULE).
  
  %% ====================================================================
  -spec start_link() -> {ok, pid()} | ignore | {error, term()}.
  start_link() ->
      gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
  
  % @doc Add a new torrent
  % <p>The torrent is given by File with the Supervisor pid as given to the
  % database structure.</p>
  % @end
  -spec new(string(), pid(), integer()) -> ok.
  new(File, Supervisor, Id) when is_integer(Id), is_pid(Supervisor), is_list(File) ->
      gen_server:call(?SERVER, {new, File, Supervisor, Id}).
  
  % @doc Return everything we are currently tracking
  % @end
  -spec all() -> {atomic, [#tracking_map{}]}.
  all() ->
      mnesia:transaction(
        fun () ->
                qlc:e(qlc:q([T || T <- mnesia:table(tracking_map)]))
        end).
  
  % @doc Find tracking map matching the Query.
  % <p>This function takes one out of 3 different query types. Either you query
  % for an integer Id of the torrent, or you query for {filename, FN} .. or you
  % query for {infohash, IH}. It returns the mnesia transaction with the result
  % of the query.</p>
  % @end
  -spec select(integer() | {filename, string()} | {infohash, binary()}) ->
        {atomic, [#tracking_map{}]} | {aborted, term()}.
  select(Id) when is_integer(Id) ->
      mnesia:transaction(
        fun () ->
  