Browse Source

Count only accepted and stale rejects in diff calculation

master
Con Kolivas 10 years ago
parent
commit
600e6923fc
  1. 11
      src/stratifier.c

11
src/stratifier.c

@ -1756,9 +1756,8 @@ static void add_submit(ckpool_t *ckp, stratum_instance_t *client, int diff, bool
stats.unaccounted_rejects += diff; stats.unaccounted_rejects += diff;
mutex_unlock(&stats_lock); mutex_unlock(&stats_lock);
/* Ignore successive rejects in count if they haven't submitted a valid /* Count only accepted and stale rejects in diff calculation. */
* share yet. */ if (!valid)
if (unlikely(!client->ssdc && !valid))
return; return;
tv_time(&now_t); tv_time(&now_t);
@ -2153,7 +2152,7 @@ static json_t *parse_submit(stratum_instance_t *client, json_t *json_msg,
} }
invalid = false; invalid = false;
out_submit: out_submit:
if (wb->proxy && sdiff >= wdiff) if (sdiff >= wdiff)
submit = true; submit = true;
out_unlock: out_unlock:
ck_runlock(&workbase_lock); ck_runlock(&workbase_lock);
@ -2189,12 +2188,12 @@ out_unlock:
/* Submit share to upstream pool in proxy mode. We submit valid and /* Submit share to upstream pool in proxy mode. We submit valid and
* stale shares and filter out the rest. */ * stale shares and filter out the rest. */
if (submit) { if (wb->proxy && submit) {
LOGINFO("Submitting share upstream: %s", hexhash); LOGINFO("Submitting share upstream: %s", hexhash);
submit_share(client, id, nonce2, ntime, nonce, json_integer_value(json_object_get(json_msg, "id"))); submit_share(client, id, nonce2, ntime, nonce, json_integer_value(json_object_get(json_msg, "id")));
} }
add_submit(ckp, client, diff, result); add_submit(ckp, client, diff, submit);
/* Now write to the pool's sharelog. */ /* Now write to the pool's sharelog. */
val = json_object(); val = json_object();

Loading…
Cancel
Save