Reverted the code that tried to randomise starting PoW position.

The problem wasn't caused by the starting position but by an int
being interpreted as a string. Fixed in upstream and merged.
This commit is contained in:
Peter Surda 2015-06-20 10:17:39 +02:00 committed by Peter Surda
parent 69309b82fb
commit bd7c3e6e01

View File

@ -43,19 +43,14 @@ def do_opencl_pow(hash, target):
kernel.set_arg(1, dest_buf)
start = time.time()
#startpos = random.getrandbits(32) << 32 | random.getrandbits(32)
#startpos = random.getrandbits(32)
startpos = 0
progress = 0
globamt = worksize*2000
while output[0][0] == 0:
kernel.set_arg(2, pack("<Q", startpos))
kernel.set_arg(2, pack("<Q", progress))
cl.enqueue_nd_range_kernel(queue, kernel, (globamt,), (worksize,))
cl.enqueue_read_buffer(queue, dest_buf, output)
queue.finish()
#startpos == (globamt + startpos) & 0xFFFFFFFFFFFFFFFF
startpos += globamt
progress += globamt
sofar = time.time() - start
print sofar, progress / sofar, "hashes/sec"