anchor.diff:                                peer_id = PeerId,
                                 parent_pid = Parent}, 0}. % Force timeout instantly.
   
  +%% @private
  +%% @todo Split and simplify this monster function
   initializing(timeout, S) ->
       case etorrent_table:acquire_check_token(S#state.id) of
           false ->
  
positive.code:     etorrent_event_mgr:completed_torrent(Id),
      etorrent_tracker_communication:completed(TrackerPid),
      {next_state, started, S};
  started({tracker_error_report, Reason}, S) ->
      io:format("Got tracker error: ~s~n", [Reason]),
      {next_state, started, S}.
  
  stopped(start, S) ->
      {stop, argh, S}.
  
  handle_event(Msg, SN, S) ->
      io:format("Problem: ~p~n", [Msg]),
      {next_state, SN, S}.
  
  handle_sync_event(_Event, _From, StateName, State) ->
      Reply = ok,
      {reply, Reply, StateName, State}.
  
  handle_info(Info, StateName, State) ->
      ?WARN([unknown_info, Info, StateName]),
      {next_state, StateName, State}.
  
  terminate(_Reason, _StateName, _S) ->
      ok.
  
  code_change(_OldVsn, StateName, State, _Extra) ->
      {ok, StateName, State}.
  
  %% --------------------------------------------------------------------
  calculate_amount_left(Id) when is_integer(Id) ->
      Pieces = etorrent_piece_mgr:select(Id),
      lists:sum([etorrent_piece_mgr:size_piece(P) || P <- Pieces]).
  
  
  
  
negative.code: -include("log.hrl").
  
  -ignore_xref([{'start_link', 3}, {start, 1}, {initializing, 2},
  	      {started, 2}, {stopped, 2}, {stop, 1}]).
  %% API
  -export([start_link/3, start/1, stop/1,
           tracker_error_report/2, completed/1,
           tracker_warning_report/2,
  
          check_torrent/1]).
  
  