Log successful submit as such

This commit is contained in:
Stefan Berger 2023-07-27 16:30:57 +02:00
parent c0af3f03b1
commit d5ac9addfe
3 changed files with 9 additions and 2 deletions

View File

@ -197,6 +197,7 @@ void runStratumWorker(void *name) {
case MINING_SET_DIFFICULTY: parse_mining_set_difficulty(line, currentPoolDifficulty);
mMiner.poolDifficulty = currentPoolDifficulty;
break;
case STRATUM_SUCCESS: Serial.println(" Parsed JSON: Success"); break;
default: Serial.println(" Parsed JSON: unknown"); break;
}

View File

@ -142,8 +142,13 @@ stratum_method parse_mining_method(String line)
if (error || checkError(doc)) return STRATUM_PARSE_ERROR;
if (!doc.containsKey("method")) return STRATUM_UNKNOWN;
if (!doc.containsKey("method")) {
// "error":null means success
if (doc["error"].isNull())
return STRATUM_SUCCESS;
else
return STRATUM_UNKNOWN;
}
stratum_method result = STRATUM_UNKNOWN;
if (strcmp("mining.notify", (const char*) doc["method"]) == 0) {

View File

@ -38,6 +38,7 @@ typedef struct {
} mining_job;
typedef enum {
STRATUM_SUCCESS,
STRATUM_UNKNOWN,
STRATUM_PARSE_ERROR,
MINING_NOTIFY,