 
     case @torrent_impl.get_next_piece_index(
            peer_data.torrent_id,
-           Map.keys(peer_data.piece_table)
+           Map.keys(peer_data.torrent_tracking_info.piece_table)
          ) do
       {:ok, next_piece_index} ->
         next_sub_piece_index = 0

        end)

        interest_msg =
          case peer_data.piece_table do
            %{} ->
              Logger.debug(fn -> "#{peer_data.name} has nothing of interest" end)



    case @torrent_impl.get_next_piece_index(
           peer_data.torrent_id,
           Map.keys(peer_data.torrent_tracking_info.piece_table)
         ) do
      {:ok, next_piece_index} ->
        next_sub_piece_index = 0
