Browse Source

Bugfix: test_hash: Fix Htarg calculation for exact binary divisions of diff 1

Luke Dashjr 11 years ago
parent
commit
5989dbf8fe
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)(1. / diff);
+	const uint32_t Htarg = (uint32_t)ceil((1. / diff) - 1);
 	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",