From feda6609c10b1c37b14fa4f7366f16e4949c30a0 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 24 Feb 2024 23:43:35 -0500 Subject: [PATCH] Correctly identify rejected stratum submission --- components/stratum/stratum_api.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/components/stratum/stratum_api.c b/components/stratum/stratum_api.c index 50ea3654..fde5e5d7 100644 --- a/components/stratum/stratum_api.c +++ b/components/stratum/stratum_api.c @@ -122,16 +122,16 @@ void STRATUM_V1_parse(StratumApiV1Message * message, const char * stratum_json) } else { // parse results cJSON * result_json = cJSON_GetObjectItem(json, "result"); - if (result_json != NULL && cJSON_IsBool(result_json)) { - + if (result_json == NULL){ + message->response_success = false; + } + else if (cJSON_IsBool(result_json)) { result = STRATUM_RESULT; - - bool response_success = false; - if (result_json != NULL && cJSON_IsTrue(result_json)) { - response_success = true; + if (cJSON_IsTrue(result_json)) { + message->response_success = true; + }else{ + message->response_success = false; } - - message->response_success = response_success; } else { cJSON * mask = cJSON_GetObjectItem(result_json, "version-rolling.mask"); if (mask != NULL) {