added support for luke-jr's "Bugfix: getmemorypool 'bits' should be a hex-string"
authorForrest Voight <forrest@forre.st>
Mon, 10 Oct 2011 05:51:30 +0000 (01:51 -0400)
committerForrest Voight <forrest@forre.st>
Mon, 10 Oct 2011 05:51:30 +0000 (01:51 -0400)
p2pool/main.py

index a2f10f7..0243baa 100644 (file)
@@ -37,7 +37,7 @@ def getwork(bitcoind, ht, net):
             transactions=[bitcoin.data.tx_type.unpack(x.decode('hex')) for x in work['transactions']],
             subsidy=work['coinbasevalue'],
             time=work['time'],
-            target=bitcoin.data.FloatingInteger(work['bits']),
+            target=bitcoin.data.FloatingIntegerType().unpack(work['bits'].decode('hex')[::-1]) if isinstance(work['bits'], (str, unicode)) else bitcoin.data.FloatingInteger(work['bits']),
         ))
     except jsonrpc.Error, e:
         if e.code != -32601: