From 010a44f01552fe500581f8fa6bdaee1e7c8207fb Mon Sep 17 00:00:00 2001 From: Forrest Voight Date: Sat, 17 Aug 2013 17:53:17 -0400 Subject: [PATCH] removed stratum nonce hacks --- p2pool/data.py | 2 +- p2pool/work.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/p2pool/data.py b/p2pool/data.py index 57f2e90..43e0d7c 100644 --- a/p2pool/data.py +++ b/p2pool/data.py @@ -208,7 +208,7 @@ class Share(object): min_header=min_header, share_info=share_info, ref_merkle_link=dict(branch=[], index=0), - last_txout_nonce=(last_txout_nonce%2**32*2**32)|(last_txout_nonce>>32), # XXX + last_txout_nonce=last_txout_nonce, hash_link=prefix_to_hash_link(bitcoin_data.tx_type.pack(gentx)[:-32-8-4], cls.gentx_before_refhash), merkle_link=bitcoin_data.calculate_merkle_link([None] + other_transaction_hashes, 0), )) diff --git a/p2pool/work.py b/p2pool/work.py index a5e6d5f..8108a59 100644 --- a/p2pool/work.py +++ b/p2pool/work.py @@ -15,10 +15,9 @@ from util import forest, jsonrpc, variable, deferral, math, pack import p2pool, p2pool.data as p2pool_data class WorkerBridge(worker_interface.WorkerBridge): - COINBASE_NONCE_LENGTH = 4 + COINBASE_NONCE_LENGTH = 8 def __init__(self, node, my_pubkey_hash, donation_percentage, merged_urls, worker_fee): - if node.net.NAME == 'bitcoin': self.COINBASE_NONCE_LENGTH = 8 worker_interface.WorkerBridge.__init__(self) self.recent_shares_ts_work = [] @@ -387,8 +386,6 @@ class WorkerBridge(worker_interface.WorkerBridge): if pow_hash <= share_info['bits'].target and header_hash not in received_header_hashes: last_txout_nonce = pack.IntType(8*self.COINBASE_NONCE_LENGTH).unpack(coinbase_nonce) - if self.node.net.NAME == 'bitcoin': - last_txout_nonce = (last_txout_nonce%2**32*2**32)|(last_txout_nonce>>32) # XXX share = get_share(header, last_txout_nonce) print 'GOT SHARE! %s %s prev %s age %.2fs%s' % ( -- 1.7.1