Browse Source

Merge commit '2fb6637' into cg_merges_20130524b

Conflicts:
	miner.c
	miner.h
Luke Dashjr 12 years ago
parent
commit
79727cf800
2 changed files with 4 additions and 4 deletions
  1. 3 4
      miner.c
  2. 1 0
      miner.h

+ 3 - 4
miner.c

@@ -6712,12 +6712,11 @@ static void bdiff_target_leadzero(unsigned char *target, double diff)
 	}
 	}
 }
 }
 
 
-static inline
-void set_work_target(struct work *work, double diff)
+void set_target(unsigned char *dest_target, double diff)
 {
 {
 	unsigned char rtarget[32];
 	unsigned char rtarget[32];
 	bdiff_target_leadzero(rtarget, diff);
 	bdiff_target_leadzero(rtarget, diff);
-	swab256(work->target, rtarget);
+	swab256(dest_target, rtarget);
 	
 	
 	if (opt_debug) {
 	if (opt_debug) {
 		char *htarget = bin2hex(rtarget, 32);
 		char *htarget = bin2hex(rtarget, 32);
@@ -6810,7 +6809,7 @@ static void gen_stratum_work(struct pool *pool, struct work *work)
 	free(header);
 	free(header);
 	calc_midstate(work);
 	calc_midstate(work);
 
 
-	set_work_target(work, work->sdiff);
+	set_target(work->target, work->sdiff);
 
 
 	local_work++;
 	local_work++;
 	work->pool = pool;
 	work->pool = pool;

+ 1 - 0
miner.h

@@ -882,6 +882,7 @@ extern void clear_stratum_shares(struct pool *pool);
 extern void hashmeter2(struct thr_info *);
 extern void hashmeter2(struct thr_info *);
 extern bool stale_work(struct work *, bool share);
 extern bool stale_work(struct work *, bool share);
 extern bool stale_work_future(struct work *, bool share, unsigned long ustime);
 extern bool stale_work_future(struct work *, bool share, unsigned long ustime);
+extern void set_target(unsigned char *dest_target, double diff);
 
 
 extern void kill_work(void);
 extern void kill_work(void);
 extern void app_restart(void);
 extern void app_restart(void);