Log successful submit as such

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

View File

@ -199,6 +199,7 @@ void runStratumWorker(void *name) {
case MINING_SET_DIFFICULTY: parse_mining_set_difficulty(line, currentPoolDifficulty); case MINING_SET_DIFFICULTY: parse_mining_set_difficulty(line, currentPoolDifficulty);
mMiner.poolDifficulty = currentPoolDifficulty; mMiner.poolDifficulty = currentPoolDifficulty;
break; break;
case STRATUM_SUCCESS: Serial.println(" Parsed JSON: Success"); break;
default: Serial.println(" Parsed JSON: unknown"); 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 (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; stratum_method result = STRATUM_UNKNOWN;
if (strcmp("mining.notify", (const char*) doc["method"]) == 0) { if (strcmp("mining.notify", (const char*) doc["method"]) == 0) {

View File

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