Browse Source

Bugfix: Avoid setting tv_idle before testing pool (it will be set if the test fails)

Luke Dashjr 11 years ago
parent
commit
01d9044a05
1 changed files with 1 additions and 2 deletions
  1. 1 2
      miner.c

+ 1 - 2
miner.c

@@ -8112,7 +8112,7 @@ retry_stratum:
 			total_getworks++;
 			pool->getwork_requested++;
 			ret = true;
-			cgtime(&pool->tv_idle);
+			pool->tv_idle = tv_getwork_reply;
 		} else {
 badwork:
 			json_decref(val);
@@ -9291,7 +9291,6 @@ static void *watchpool_thread(void __maybe_unused *userdata)
 
 			/* Test pool is idle once every minute */
 			if (pool->idle && now.tv_sec - pool->tv_idle.tv_sec > 30) {
-				cgtime(&pool->tv_idle);
 				if (pool_active(pool, true) && pool_tclear(pool, &pool->idle))
 					pool_resus(pool);
 			}