Browse Source

Even if we want to submit stale shares, give up if we have more submissions waiting on threads (even before failing)

Failure can take a whole minute, during which more stales will have piled up.
Unless we discard before trying those, this could grow exponentially. :(
Luke Dashjr 13 years ago
parent
commit
d42ebcfb8b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      cgminer.c

+ 5 - 0
cgminer.c

@@ -2251,6 +2251,11 @@ next_submit:
 
 	if (stale_work(work, true)) {
 		work->stale = true;
+		if (unlikely(!list_empty(&submit_waiting))) {
+			applog(LOG_WARNING, "Stale share detected while queued submissions are waiting, discarding");
+			submit_discard_share(work);
+			goto out;
+		}
 		if (opt_submit_stale)
 			applog(LOG_NOTICE, "Stale share detected, submitting as user requested");
 		else if (pool->submit_old)