From 31221dd0b46dc5590d2cdc3d47f9ae255fd2e194 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 21 Aug 2014 13:27:29 +1000 Subject: [PATCH] Clamp max diff in proxy mode to the current upstream pool's diff --- src/stratifier.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index c6004513..fc8a0914 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1417,7 +1417,10 @@ static void add_submit(ckpool_t *ckp, stratum_instance_t *client, int diff, bool ck_rlock(&workbase_lock); next_blockid = workbase_id + 1; - network_diff = current_workbase->network_diff; + if (ckp->proxy) + network_diff = current_workbase->diff; + else + network_diff = current_workbase->network_diff; ck_runlock(&workbase_lock); tdiff = sane_tdiff(&now_t, &client->last_share); @@ -1770,7 +1773,7 @@ static json_t *parse_submit(stratum_instance_t *client, json_t *json_msg, goto out_unlock; } invalid = false; - if (wb->proxy && sdiff > wdiff) + if (wb->proxy && sdiff >= wdiff) submit = true; out_unlock: ck_runlock(&workbase_lock);