From d19a682d926ea2247b500a2d185ea4e0440a829a Mon Sep 17 00:00:00 2001 From: ckolivas Date: Thu, 22 May 2014 10:26:52 +1000 Subject: [PATCH] Set the maximum pplns window to 5xdiff --- src/stratifier.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index c2862ccd..449e27b0 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -810,14 +810,16 @@ static void log_pplns(const char *logdir, user_instance_t *instance) * the pool's restart ! */ static void block_solve(ckpool_t *ckp) { - double total = 0, retain = 0, window; + double total = 0, retain = 0, window, max_window; user_instance_t *instance, *tmp; ck_rlock(&workbase_lock); - window = current_workbase->network_diff; + max_window = current_workbase->network_diff; ck_runlock(&workbase_lock); - window /= 5; + window = max_window / 5; + max_window *= 5; + LOGWARNING("Block solve user summary"); ck_rlock(&instance_lock); @@ -828,6 +830,8 @@ static void block_solve(ckpool_t *ckp) /* What proportion of shares should each user retain */ if (total > window) retain = (total - window) / total; + if (total > max_window) + retain *= (max_window / total); HASH_ITER(hh, user_instances, instance, tmp) { double residual, shares;