Browse Source

Round target difficulties down to be in keeping with the rounding of detected share difficulties.

Con Kolivas 13 years ago
parent
commit
d4f8a0b2b5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      cgminer.c

+ 2 - 2
cgminer.c

@@ -2048,7 +2048,7 @@ static bool submit_upstream_work(const struct work *work, CURL *curl, bool resub
 		if (opt_scrypt)
 			sprintf(hashshow, "%08lx.%08lx", (unsigned long)(hash32[7]), (unsigned long)(hash32[6]));
 		else {
-			int intdiff = round(work->work_difficulty);
+			int intdiff = floor(work->work_difficulty);
 			uint64_t sharediff = share_diff(work);
 			char diffdisp[16];
 
@@ -4146,7 +4146,7 @@ static void stratum_share_result(json_t *val, json_t *res_val, json_t *err_val,
 	int intdiff;
 
 	hash32 = (uint32_t *)(work->hash);
-	intdiff = round(work->work_difficulty);
+	intdiff = floor(work->work_difficulty);
 	suffix_string(sharediff, diffdisp, 0);
 	sprintf(hashshow, "%08lx Diff %s/%d%s", (unsigned long)(hash32[6]), diffdisp, intdiff,
 		work->block? " BLOCK!" : "");