Browse Source

Merge pull request #539 from dvitas/bfgminer

Bugfix: Fix target calculation from diff < 1.0 in test_hash()
Nate Woolls 11 years ago
parent
commit
91b1fd2e54
1 changed files with 1 additions and 1 deletions
  1. 1 1
      miner.c

+ 1 - 1
miner.c

@@ -9562,7 +9562,7 @@ bool test_hash(const void * const phash, const float diff)
 		// FIXME: > 1 should check more
 		// FIXME: > 1 should check more
 		return !hash[7];
 		return !hash[7];
 	
 	
-	const uint32_t Htarg = (uint32_t)(0x100000000 * diff) - 1;
+	const uint32_t Htarg = (uint32_t)(1. / diff);
 	const uint32_t tmp_hash7 = le32toh(hash[7]);
 	const uint32_t tmp_hash7 = le32toh(hash[7]);
 	
 	
 	applog(LOG_DEBUG, "htarget %08lx hash %08lx",
 	applog(LOG_DEBUG, "htarget %08lx hash %08lx",