anchor.diff:  %% Description: Set the state of an info hash.
   %%--------------------------------------------------------------------
   set_torrent_state(Id, S) when is_integer(Id) ->
  -    {atomic, InfoHash} = mnesia:transaction(
  -			   fun () ->
  -				   Q = qlc:q([R || R <- mnesia:table(torrent),
  -						   R#torrent.storer_pid =:= Pid]),
  -				   [IH] = qlc:e(Q),
  -				   IH
  -			   end),
  -    set_torrent_state(InfoHash, S);
  -set_torrent_state(InfoHash, State) ->
  -    F = fun() ->
  -		case mnesia:read(torrent, InfoHash, write) of
  +    F = fun() ->
  +		case mnesia:read(torrent, Id, write) of
   		    [T] ->
  -			New = case State of
  +			New = case S of
   				  unknown ->
   				      T#torrent{state = unknown};
   				  leeching ->
  
positive.code: %% Function: delete_torrent_by_pid(Pid) -> transaction
  %% Description: Remove the row with Pid in it
  %%--------------------------------------------------------------------
  delete_torrent_by_pid(Pid) ->
      error_logger:info_report([delete_torrent_by_pid, Pid]),
      F = fun() ->
  		Q = qlc:q([T || T <- mnesia:table(torrent),
  				T#torrent.storer_pid =:= Pid]),
  		lists:foreach(fun (Tr) -> mnesia:delete(Tr) end, qlc:e(Q))
  	end,
      mnesia:transaction(F).
  
  
  %%--------------------------------------------------------------------
  %% Function: store_peer(IP, Port, InfoHash, Pid) -> transaction
  
negative.code: 
  %% API
  -export([new_torrent/3, cleanup_torrent_by_pid/1,
  	 store_torrent/2, set_torrent_state/2,
  	 select_torrent/1, delete_torrent/1, delete_torrent_by_pid/1,
  	 store_peer/4, select_peer_ip_port_by_pid/1, delete_peer/1,
  	 peer_statechange/2, is_peer_connected/3, select_interested_peers/1,
  