anchor.diff:      {noreply, S, 0};
   handle_cast(interested, S) ->
       {noreply, statechange_interested(S, true), 0};
  -handle_cast({have, PieceNumber}, S) ->
  -    case gb_sets:is_element(PieceNumber, S#state.piece_set) of
  -	true ->
  -	    % Remote already has the piece, ignore telling him
  -	    ok;
  -	false ->
  -	    ok = etorrent_t_peer_send:have(S#state.send_pid, PieceNumber)
  +handle_cast({have, PN}, S) when S#state.piece_set =:= unknown ->
  +    etorrent_t_peer_send:have(S#state.send_pid, PN),
  +    {noreply, S, 0};
  +handle_cast({have, PN}, S) ->
  +    case gb_sets:is_element(PN, S#state.piece_set) of
  +	true -> ok;
  +	false -> ok = etorrent_t_peer_send:have(S#state.send_pid, PN)
       end,
       {noreply, S, 0};
   handle_cast({endgame_got_chunk, Chunk}, S) ->
  
positive.code:     {ok, S};
  handle_message({have, PieceNum}, S) ->
      peer_have(PieceNum, S);
  handle_message({bitfield, BitField}, S) ->
      case gb_sets:size(S#state.piece_set) of
  	0 ->
  	    Size = etorrent_torrent:num_pieces(S#state.torrent_id),
  	    {ok, PieceSet} =
  		etorrent_peer_communication:destruct_bitfield(Size, BitField),
  	    Left = S#state.pieces_left - gb_sets:size(PieceSet),
  	    case Left of
  		0  -> ok = etorrent_peer:statechange(self(), seeder);
  		_N -> ok
  	    end,
  	    case etorrent_piece_mgr:check_interest(S#state.torrent_id, PieceSet) of
  		interested ->
  		    {ok, statechange_interested(S#state {piece_set = PieceSet,
  							 pieces_left = Left,
  							 seeder = Left == 0},
  						true)};
  		not_interested ->
  		    {ok, S#state{piece_set = PieceSet, pieces_left = Left,
  				 seeder = Left == 0}};
  		invalid_piece ->
  		    {stop, {invalid_piece_2, S#state.remote_peer_id}, S}
  	    end;
  	N when is_integer(N) ->
  	    %% This is a bad peer. Kill him!
  	    {ok, {IP, Port}} = inet:peername(S#state.tcp_socket),
  	    etorrent_peer_mgr:enter_bad_peer(IP, Port, S#state.remote_peer_id),
  	    {stop, normal, S}
      end;
  handle_message({piece, Index, Offset, Data}, S) ->
      case handle_got_chunk(Index, Offset, Data, size(Data), S) of
  
negative.code: 
  		 remote_request_set = none,
  
  		 piece_set = unknown,
  		 piece_request = [],
  
  		 packet_left = none,
  