Browse Source

Bugfix: Log work updates for all active pools in multipool mode

Luke Dashjr 11 years ago
parent
commit
333530af92
1 changed files with 12 additions and 12 deletions
  1. 12 12
      miner.c

+ 12 - 12
miner.c

@@ -6305,16 +6305,15 @@ static bool test_work_current(struct work *work)
 		}
 		}
 		if (work->longpoll)
 		if (work->longpoll)
 		{
 		{
+			struct pool * const cp = current_pool();
 			++pool->work_restart_id;
 			++pool->work_restart_id;
 			update_last_work(work);
 			update_last_work(work);
-			if ((!restart) && pool == current_pool())
-			{
-				applog(
-				       (opt_quiet_work_updates ? LOG_DEBUG : LOG_NOTICE),
-				       "Longpoll from pool %d requested work update",
-					pool->pool_no);
+			applog(
+			       ((!opt_quiet_work_updates) && pool_actively_in_use(pool, cp) ? LOG_NOTICE : LOG_DEBUG),
+			       "Longpoll from pool %d requested work update",
+				pool->pool_no);
+			if ((!restart) && pool == cp)
 				restart = true;
 				restart = true;
-			}
 		}
 		}
 		if (restart)
 		if (restart)
 			restart_threads();
 			restart_threads();
@@ -8298,12 +8297,13 @@ static void *stratum_thread(void *userdata)
 			if (test_work_current(work)) {
 			if (test_work_current(work)) {
 				/* Only accept a work update if this stratum
 				/* Only accept a work update if this stratum
 				 * connection is from the current pool */
 				 * connection is from the current pool */
-				if (pool == current_pool()) {
+				struct pool * const cp = current_pool();
+				if (pool == cp)
 					restart_threads();
 					restart_threads();
-					applog(
-					       (opt_quiet_work_updates ? LOG_DEBUG : LOG_NOTICE),
-					       "Stratum from pool %d requested work update", pool->pool_no);
-				}
+				
+				applog(
+				       ((!opt_quiet_work_updates) && pool_actively_in_use(pool, cp) ? LOG_NOTICE : LOG_DEBUG),
+				       "Stratum from pool %d requested work update", pool->pool_no);
 			} else
 			} else
 				applog(LOG_NOTICE, "Stratum from pool %d detected new block", pool->pool_no);
 				applog(LOG_NOTICE, "Stratum from pool %d detected new block", pool->pool_no);
 			free_work(work);
 			free_work(work);