Handle subscribe response errors on json parsing
When setting up a connection to the ckpool server and sending a handle subscribe message, there is an error that indicates the response contains more than one JSON object or extraneous data at the end. When there is more than one JSON object or extraneous data in the response, the Python loads() method will fail with a JSONDecoder error containing the string "Extra data".
Python library decoder.py error with "Extra data" thrown on line 347 here: https://github.com/python/cpython/blob/main/Lib/json/decoder.py
Stacktrace example:
Traceback (most recent call last): File "/Users/user/Documents/SOLO_MINER/PythonBitcoinMiner/SoloMiner.py", line 500, in thread_new_block ret = block_listener(self) ^^^^^^^^^^^^^^^^^^^^ File "/Users/user/Documents/SOLO_MINER/PythonBitcoinMiner/SoloMiner.py", line 446, in block_listener responses = [json.loads(res) for res in response.decode().split('\n') if ^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 2 (char 1)
I was going to submit a fix for this, but since you closed this with no discussion then I'll just let everyone who uses your repo continue to get errors and potentially mine on an outdated block template. Well done.
I was going to submit a fix for this, but since you closed this with no discussion then I'll just let everyone who uses your repo continue to get errors and potentially mine on an outdated block template. Well done.
Sorry about that.Recently I was really busy and out of time to deal with the bug.But if you still want to contribute,you can still pull request and I will accept that after check
All Bug are fixed at Beta Version v2.0.0