From 7638511290d3fc2fd03bace77e01789ffec11385 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Tue, 1 May 2012 09:54:34 +1000 Subject: [PATCH] We should not retry submitting shares indefinitely or we may end up with a huge backlog during network outages, so discard stale shares if we failed to submit them and they've become stale in the interim. --- cgminer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cgminer.c b/cgminer.c index a4d21a64..28dd38b0 100644 --- a/cgminer.c +++ b/cgminer.c @@ -2158,8 +2158,8 @@ static void *submit_work_thread(void *userdata) /* submit solution to bitcoin via JSON-RPC */ while (!submit_upstream_work(work, pool->submit_curl)) { - if (!opt_submit_stale && stale_work(work, true) && !pool->submit_old) { - applog(LOG_NOTICE, "Stale share detected on submit retry, discarding"); + if (stale_work(work, true)) { + applog(LOG_NOTICE, "Share became stale while retrying submit, discarding"); total_stale++; pool->stale_shares++; break; @@ -2211,8 +2211,8 @@ static void *submit_extra_work(void *userdata) /* submit solution to bitcoin via JSON-RPC */ while (!submit_upstream_work(work, curl)) { - if (!opt_submit_stale && stale_work(work, true)) { - applog(LOG_NOTICE, "Stale share detected, discarding"); + if (stale_work(work, true)) { + applog(LOG_NOTICE, "Share became stale while retrying submit, discarding"); total_stale++; pool->stale_shares++; break;