def startCheckingPieces(torrentData)
      torrentData.pieceManager = QuartzTorrent::PieceManager.new(@baseDirectory, torrentData.info)

      torrentData.state = :checking_pieces
      @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Checking pieces of torrent #{QuartzTorrent.bytesToHex(torrentData.infoHash)} asynchronously."
      id = torrentData.pieceManager.findExistingPieces
      torrentData.pieceManagerRequestMetadata[id] = PieceManagerRequestMetadata.new(:check_existing, nil)

      if ! torrentData.metainfoPieceState
        torrentData.metainfoPieceState = MetainfoPieceState.new(@baseDirectory, torrentData.infoHash, nil, torrentData.info)
      end

      # Schedule checking for PieceManager results
      torrentData.checkPieceManagerTimer =
        @reactor.scheduleTimer(@requestBlocksPeriod, [:check_piece_manager, torrentData.infoHash], true, false)

      # Schedule checking for metainfo PieceManager results (including when piece reading completes)
      if ! torrentData.checkMetadataPieceManagerTimer
        torrentData.checkMetadataPieceManagerTimer =
          @reactor.scheduleTimer(@requestBlocksPeriod, [:check_metadata_piece_manager, torrentData.infoHash], true, false)
      end
    end
def startCheckingPieces(torrentData)
      torrentData.pieceManager = QuartzTorrent::PieceManager.new(@baseDirectory, torrentData.info)

      torrentData.state = :checking_pieces
      @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Checking pieces of torrent #{QuartzTorrent.bytesToHex(torrentData.infoHash)} asynchronously."
      id = torrentData.pieceManager.findExistingPieces
      torrentData.pieceManagerRequestMetadata[id] = PieceManagerRequestMetadata.new(:check_existing, nil)

      if ! torrentData.metainfoPieceState
        torrentData.metainfoPieceState = MetainfoPieceState.new(@baseDirectory, torrentData.infoHash, nil, torrentData.info)
      end

      # Schedule checking for PieceManager results
      torrentData.checkPieceManagerTimer =
        @reactor.scheduleTimer(@requestBlocksPeriod, [:check_piece_manager, torrentData.infoHash], true, false)

      # Schedule checking for metainfo PieceManager results (including when piece reading completes)
      if ! torrentData.checkMetadataPieceManagerTimer
        torrentData.checkMetadataPieceManagerTimer =
          @reactor.scheduleTimer(@requestBlocksPeriod, [:check_metadata_piece_manager, torrentData.infoHash], true, false)
      end
    end
Start checking which pieces we already have downloaded. This method schedules the necessary timers
 and changes the state to :checking_pieces. When the pieces are finished being checked the actual download will
 begin.
 Preconditions: The torrentData object already has it's info member set.