From 5f9b67f82efbbe6f5f654e78d4a5e53f9158af41 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 27 Apr 2014 22:21:12 +1000 Subject: [PATCH] Avoid re-setting reject reason when sdiff is not calculated --- src/stratifier.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 80d10a98..5fbc56c5 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -852,10 +852,10 @@ static json_t *parse_submit(stratum_instance_t *client, json_t *json_msg, json_t *params_val, json_t **err_val) { const char *user, *job_id, *nonce2, *ntime, *nonce; + double sdiff = -1; uint32_t ntime32; bool ret = false; workbase_t *wb; - double sdiff; int diff, id; if (unlikely(!json_is_array(params_val))) { @@ -931,7 +931,8 @@ out_unlock: ret = true; } else { add_submit_fail(client, diff); - json_object_set_nocheck(json_msg, "reject-reason", json_string("Above target")); + if (sdiff >= 0) + json_object_set_nocheck(json_msg, "reject-reason", json_string("Above target")); } out: return json_boolean(ret);