Browse Source

Bugfix: Supress "caught up" event when first switching to a pool

Luke Dashjr 13 years ago
parent
commit
b39ff49296
1 changed files with 3 additions and 2 deletions
  1. 3 2
      cgminer.c

+ 3 - 2
cgminer.c

@@ -2391,6 +2391,7 @@ void switch_pools(struct pool *selected)
 
 	currentpool = pools[pool_no];
 	pool = currentpool;
+	pool->block_id = 0;
 	mutex_unlock(&control_lock);
 
 	if (pool != last_pool)
@@ -2594,9 +2595,9 @@ static void test_work_current(struct work *work)
 		bool restart = false;
 		struct pool *curpool = NULL;
 		if (unlikely(work->pool->block_id != block_id && block_id == current_block_id)) {
+			bool was_active = work->pool->block_id != 0;
 			work->pool->block_id = block_id;
-			curpool = current_pool();
-			if (work->pool == curpool) {
+			if (was_active && work->pool == (curpool = current_pool())) {
 				applog(LOG_NOTICE, "%s %d caught up to new block",
 				       work->longpoll ? "LONGPOLL from pool" : "Pool",
 				       work->pool->pool_no);