Exemplo n.º 1
0
def _doGPUPoW(target, initialHash):
    logger.debug("GPU PoW start")
    nonce = openclpow.do_opencl_pow(initialHash.encode("hex"), target)
    trialValue, = unpack(
        '>Q',
        hashlib.sha512(
            hashlib.sha512(pack('>Q', nonce) +
                           initialHash).digest()).digest()[0:8])
    #print "{} - value {} < {}".format(nonce, trialValue, target)
    if trialValue > target:
        deviceNames = ", ".join(gpu.name for gpu in openclpow.gpus)
        UISignalQueue.put((
            'updateStatusBar',
            tr._translate(
                "MainWindow",
                'Your GPU(s) did not calculate correctly, disabling OpenCL. Please report to the developers.'
            )))
        logger.error(
            "Your GPUs (%s) did not calculate correctly, disabling OpenCL. Please report to the developers.",
            deviceNames)
        openclpow.ctx = False
        raise Exception("GPU did not calculate correctly.")
    if shutdown != 0:
        raise Exception("Interrupted")
    logger.debug("GPU PoW done")
    return [trialValue, nonce]
Exemplo n.º 2
0
def _doGPUPoW(target, initialHash):
    print "GPU PoW start"
    nonce = openclpow.do_opencl_pow(initialHash.encode("hex"), target)
    trialValue, = unpack('>Q',hashlib.sha512(hashlib.sha512(pack('>Q',nonce) + initialHash).digest()).digest()[0:8])
    #print "{} - value {} < {}".format(nonce, trialValue, target)
    print "GPU PoW done"
    return [trialValue, nonce]
Exemplo n.º 3
0
def _doGPUPoW(target, initialHash):
    print "GPU PoW start"
    nonce = openclpow.do_opencl_pow(initialHash.encode("hex"), target)
    trialValue, = unpack(
        '>Q',
        hashlib.sha512(
            hashlib.sha512(pack('>Q', nonce) +
                           initialHash).digest()).digest()[0:8])
    #print "{} - value {} < {}".format(nonce, trialValue, target)
    print "GPU PoW done"
    return [trialValue, nonce]
Exemplo n.º 4
0
def _doGPUPoW(target, initialHash):
    logger.debug("GPU PoW start")
    nonce = openclpow.do_opencl_pow(initialHash.encode("hex"), target)
    trialValue, = unpack('>Q',hashlib.sha512(hashlib.sha512(pack('>Q',nonce) + initialHash).digest()).digest()[0:8])
    #print "{} - value {} < {}".format(nonce, trialValue, target)
    if trialValue > target:
        deviceNames = ", ".join(gpu.name for gpu in openclpow.gpus)
        UISignalQueue.put(('updateStatusBar', tr.translateText("MainWindow",'Your GPU(s) did not calculate correctly, disabling OpenCL. Please report to the developers.')))
        logger.error("Your GPUs (%s) did not calculate correctly, disabling OpenCL. Please report to the developers.", deviceNames)
        openclpow.ctx = False
        raise Exception("GPU did not calculate correctly.")
    logger.debug("GPU PoW done")
    return [trialValue, nonce]