m0mchil/poclbm — pull request #45 by makomk (2012-02-04 23:14:43+00:00)
Title: Fix: poclbm failing since the last difficulty change, bug in true difficulty calculation

Since the last difficulty change poclbm has been failing with errors like:

File "/home/jglauche/src/poclbm/Transport.py", line 98, in set_difficulty
self.true_target = np.array(unpack('IIIIIIII', true_target.decode('hex')), dtype=np.uint32)
error: unpack requires a string argument of length 32

The problem is that we're extracting bits from the block wrong if the
data in the block header starts with a 0 in hex, and this causes the
true difficulty computation to error out. Fix this by handling leading
zeroes correctly.