Browse Source

Make sure to give work items a starting time only once when they're staged.

Con Kolivas 14 years ago
parent
commit
626ae10d7c
2 changed files with 6 additions and 1 deletions
  1. 5 1
      main.c
  2. 1 0
      miner.h

+ 5 - 1
main.c

@@ -1582,8 +1582,12 @@ static void *stage_thread(void *userdata)
 		}
 
 		test_work_current(work);
-		if (!work->cloned && !work->clone)
+		/* Stage date the work only once since it may be rolled
+		 * or cloned and be staged again */
+		if (!work->staged) {
 			gettimeofday(&work->tv_staged, NULL);
+			work->staged = true;
+		}
 
 		if (opt_debug)
 			applog(LOG_DEBUG, "Pushing work to getwork queue");

+ 1 - 0
miner.h

@@ -345,6 +345,7 @@ struct work {
 	bool		clone;
 	bool		cloned;
 	bool		rolltime;
+	bool		staged;
 };
 
 enum cl_kernel {