anchor.diff:      end.
   
   %% @private
  -started(stop, S) ->
  -    {stop, argh, S};
   started(check_torrent, S) ->
       case check_torrent_for_bad_pieces(S#state.id) of
           [] -> {next_state, started, S};
  
positive.code: started(completed, #state { id = Id, tracker_pid = TrackerPid } = S) ->
      etorrent_event:completed_torrent(Id),
      etorrent_tracker_communication:completed(TrackerPid),
      {next_state, started, S};
  %% @todo kill this
  started({tracker_error_report, Reason}, S) ->
      io:format("Got tracker error: ~s~n", [Reason]),
      {next_state, started, S};
  started({tracker_warning_report, Reason}, S) ->
      io:format("Got tracker warning report: ~s~n", [Reason]),
      {next_state, started, S}.
  
  %% @private
  stopped(start, S) ->
      {stop, argh, S}.
  
  %% @private
  handle_event(Msg, SN, S) ->
  
negative.code: -include("log.hrl").
  
  -ignore_xref([{'start_link', 3}, {start, 1}, {initializing, 2},
  	      {started, 2}]).
  %% API
  -export([start_link/3, completed/1, check_torrent/1]).
  
  %% gen_fsm callbacks
  -export([init/1, handle_event/3, initializing/2, started/2,
           handle_sync_event/4, handle_info/3, terminate/3,
           code_change/4]).
  
  -record(state, {id                :: integer() ,
  