diff --git a/src/stratifier.c b/src/stratifier.c index 63d4cb07..a454581c 100644 --- a/src/stratifier.c +++ b/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) 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 */ if (optimal < ckp->mindiff) optimal = ckp->mindiff;