Browse Source

Don't make donation work interfere with block change detection allowing donation to work regardless of the block chain we're mining on.

Con Kolivas 14 years ago
parent
commit
ac0d303075
1 changed files with 9 additions and 0 deletions
  1. 9 0
      main.c

+ 9 - 0
main.c

@@ -2502,6 +2502,10 @@ static bool stale_work(struct work *work)
 	if ((now.tv_sec - work->tv_staged.tv_sec) >= opt_scantime)
 		return true;
 
+	/* Don't compare donor work in case it's on a different chain */
+	if (donor(work->pool))
+		return ret;
+
 	hexstr = bin2hex(work->data, 18);
 	if (unlikely(!hexstr)) {
 		applog(LOG_ERR, "submit_work_thread OOM");
@@ -2766,6 +2770,11 @@ static void test_work_current(struct work *work, bool longpoll)
 	struct block *s;
 	char *hexstr;
 
+	/* Allow donation to not set current work, so it will work even if
+	 * mining on a different chain */
+	if (donor(work->pool))
+		return;
+
 	hexstr = bin2hex(work->data, 18);
 	if (unlikely(!hexstr)) {
 		applog(LOG_ERR, "stage_thread OOM");