Skip to content

Commit

Permalink
deal with stupid backwards-incompatible change to merge mining appare…
Browse files Browse the repository at this point in the history
…ntly pushed by F2Pool(?)
  • Loading branch information
forrestv committed Sep 9, 2015
1 parent 548bcc3 commit a6f3f92
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion p2pool/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ def set_merged_work(merged_url, merged_userpass):
merged_proxy = jsonrpc.HTTPProxy(merged_url, dict(Authorization='Basic ' + base64.b64encode(merged_userpass)))
while self.running:
auxblock = yield deferral.retry('Error while calling merged getauxblock on %s:' % (merged_url,), 30)(merged_proxy.rpc_getauxblock)()
target = auxblock['target'] if 'target' in auxblock else auxblock['_target']
self.merged_work.set(math.merge_dicts(self.merged_work.value, {auxblock['chainid']: dict(
hash=int(auxblock['hash'], 16),
target='p2pool' if auxblock['target'] == 'p2pool' else pack.IntType(256).unpack(auxblock['target'].decode('hex')),
target='p2pool' if target == 'p2pool' else pack.IntType(256).unpack(target.decode('hex')),
merged_proxy=merged_proxy,
)}))
yield deferral.sleep(1)
Expand Down

0 comments on commit a6f3f92

Please sign in to comment.