Jan 26, 2022 01:26 PM
(This post was last modified: Jan 27, 2022 12:43 AM by Fhack.)
Hello i wonder how to get job difficulty from data sent by the pool :
Does there is a way to extract difficulty from this ? because it's showned on xmrig so i wonder how they do that !
Found the solution in python :
Code
{"id":1,"jsonrpc":"2.0","error":null,"result":{"id":"300955505552701","job": {"blob":"0202b4d88cd005723910a7844c6cf04bb10af456fdf6e4b352e1839747d3e971117b7550da82550000000028b751d55f1b5c591ef82e4ec90a621a32f48044e8e112fa8ff4be5b3b046a6a04","job_id":"129359229584224","target":"9bc42000"},"status":"OK"}}Does there is a way to extract difficulty from this ? because it's showned on xmrig so i wonder how they do that !
Found the solution in python :
Code
def _getDifficulty(self):
target = int(self.target, 16)
diff = struct.unpack("<I", struct.pack(">I", target))[0]
return int(0x100000001 / int(diff))
