Browse Source

Round away from zero when choosing optimal diff

master
Con Kolivas 10 years ago
parent
commit
c4506c7e47
  1. 4
      src/stratifier.c

4
src/stratifier.c

@ -1735,7 +1735,9 @@ static void add_submit(ckpool_t *ckp, stratum_instance_t *client, int diff, bool
if (drr > 0.15 && drr < 0.4) if (drr > 0.15 && drr < 0.4)
return; return;
optimal = round(dsps * 3.33); /* Round away from zero to avoid bouncing around diffs at the lower
* end of the scale. */
optimal = lround(dsps * 3.33);
/* Clamp to mindiff ~ network_diff */ /* Clamp to mindiff ~ network_diff */
if (optimal < ckp->mindiff) if (optimal < ckp->mindiff)
optimal = ckp->mindiff; optimal = ckp->mindiff;

Loading…
Cancel
Save