def handleCheckExistingResult(torrentData, pieceManagerResult)
      if pieceManagerResult.successful?
        existingBitfield = pieceManagerResult.data
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: We already have #{existingBitfield.countSet}/#{existingBitfield.length} pieces." 

        info = torrentData.info
       
        torrentData.blockState = BlockState.new(info, existingBitfield)

        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Starting torrent. Information:"
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}:   piece length:     #{info.pieceLen}"
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}:   number of pieces: #{info.pieces.size}"
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}:   total length      #{info.dataLength}"

        startDownload torrentData
      else
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Checking existing pieces of torrent failed: #{pieceManagerResult.error}"
        torrentData.state = :error
      end
    end
def handleCheckExistingResult(torrentData, pieceManagerResult)
      if pieceManagerResult.successful?
        existingBitfield = pieceManagerResult.data
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: We already have #{existingBitfield.countSet}/#{existingBitfield.length} pieces." 

        info = torrentData.info
       
        torrentData.blockState = BlockState.new(info, existingBitfield)

        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Starting torrent. Information:"
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}:   piece length:     #{info.pieceLen}"
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}:   number of pieces: #{info.pieces.size}"
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}:   total length      #{info.dataLength}"

        startDownload torrentData
      else
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Checking existing pieces of torrent failed: #{pieceManagerResult.error}"
        torrentData.state = :error
      end
    end
Handle the result of the PieceManager's checkExisting (check which pieces we already have) operation.
 If the resukt is successful, this begins the actual download.