From e9d1e13dc4a1dd6e15ec208cb70195cc054930aa Mon Sep 17 00:00:00 2001 From: Ahmed Bodiwala Date: Sun, 5 Jan 2014 21:13:52 +0000 Subject: [PATCH] Another Fix --- lib/template_registry.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/template_registry.py b/lib/template_registry.py index c24137e..f8c5d0d 100644 --- a/lib/template_registry.py +++ b/lib/template_registry.py @@ -268,9 +268,12 @@ class TemplateRegistry(object): log.info("We found a block candidate! %s" % scrypt_hash_hex) # Reverse the header and get the potential block hash (for scrypt only) - block_hash_bin = util.doublesha(''.join([ header_bin[i*4:i*4+4][::-1] for i in range(0, 20) ])) - block_hash_hex = block_hash_bin[::-1].encode('hex_codec') - + if settings.COINDAEMON_ALGO == 'scrypt' or settings.COINDAEMON_ALGO == 'sha256d': + if settings.COINDAEMON_Reward == 'POW': + block_hash_bin = util.doublesha(''.join([ header_bin[i*4:i*4+4][::-1] for i in range(0, 20) ])) + block_hash_hex = block_hash_bin[::-1].encode('hex_codec') + else: + block_hash_hex = hash_bin[::-1].encode('hex_codec') # 6. Finalize and serialize block object job.finalize(merkle_root_int, extranonce1_bin, extranonce2_bin, int(ntime, 16), int(nonce, 16))