Browse Source

Clamp max diff in proxy mode to the current upstream pool's diff

master
Con Kolivas 10 years ago
parent
commit
31221dd0b4
  1. 5
      src/stratifier.c

5
src/stratifier.c

@ -1417,6 +1417,9 @@ static void add_submit(ckpool_t *ckp, stratum_instance_t *client, int diff, bool
ck_rlock(&workbase_lock); ck_rlock(&workbase_lock);
next_blockid = workbase_id + 1; next_blockid = workbase_id + 1;
if (ckp->proxy)
network_diff = current_workbase->diff;
else
network_diff = current_workbase->network_diff; network_diff = current_workbase->network_diff;
ck_runlock(&workbase_lock); ck_runlock(&workbase_lock);
@ -1770,7 +1773,7 @@ static json_t *parse_submit(stratum_instance_t *client, json_t *json_msg,
goto out_unlock; goto out_unlock;
} }
invalid = false; invalid = false;
if (wb->proxy && sdiff > wdiff) if (wb->proxy && sdiff >= wdiff)
submit = true; submit = true;
out_unlock: out_unlock:
ck_runlock(&workbase_lock); ck_runlock(&workbase_lock);

Loading…
Cancel
Save