Browse Source

Avoid re-setting reject reason when sdiff is not calculated

master
Con Kolivas 11 years ago
parent
commit
5f9b67f82e
  1. 5
      src/stratifier.c

5
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) json_t *params_val, json_t **err_val)
{ {
const char *user, *job_id, *nonce2, *ntime, *nonce; const char *user, *job_id, *nonce2, *ntime, *nonce;
double sdiff = -1;
uint32_t ntime32; uint32_t ntime32;
bool ret = false; bool ret = false;
workbase_t *wb; workbase_t *wb;
double sdiff;
int diff, id; int diff, id;
if (unlikely(!json_is_array(params_val))) { if (unlikely(!json_is_array(params_val))) {
@ -931,7 +931,8 @@ out_unlock:
ret = true; ret = true;
} else { } else {
add_submit_fail(client, diff); 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: out:
return json_boolean(ret); return json_boolean(ret);

Loading…
Cancel
Save