Browse Source

Build without POW_SCRYPT at all

Luke Dashjr 11 years ago
parent
commit
f1ffa2aaaf
4 changed files with 10 additions and 0 deletions
  1. 4 0
      deviceapi.c
  2. 2 0
      driver-cpu.c
  3. 2 0
      driver-getwork.c
  4. 2 0
      miner.h

+ 4 - 0
deviceapi.c

@@ -90,8 +90,10 @@ float common_sha256d_and_scrypt_min_nonce_diff(struct cgpu_info * const proc, co
 {
 {
 	switch (malgo->algo)
 	switch (malgo->algo)
 	{
 	{
+#ifdef USE_SCRYPT
 		case POW_SCRYPT:
 		case POW_SCRYPT:
 			return 1./0x10000;
 			return 1./0x10000;
+#endif
 		case POW_SHA256D:
 		case POW_SHA256D:
 			return 1.;
 			return 1.;
 		default:
 		default:
@@ -99,10 +101,12 @@ float common_sha256d_and_scrypt_min_nonce_diff(struct cgpu_info * const proc, co
 	}
 	}
 }
 }
 
 
+#ifdef USE_SCRYPT
 float common_scrypt_min_nonce_diff(struct cgpu_info * const proc, const struct mining_algorithm * const malgo)
 float common_scrypt_min_nonce_diff(struct cgpu_info * const proc, const struct mining_algorithm * const malgo)
 {
 {
 	return (malgo->algo == POW_SCRYPT) ? (1./0x10000) : -1.;
 	return (malgo->algo == POW_SCRYPT) ? (1./0x10000) : -1.;
 }
 }
+#endif
 
 
 bool hashes_done(struct thr_info *thr, int64_t hashes, struct timeval *tvp_hashes, uint32_t *max_nonce)
 bool hashes_done(struct thr_info *thr, int64_t hashes, struct timeval *tvp_hashes, uint32_t *max_nonce)
 {
 {

+ 2 - 0
driver-cpu.c

@@ -823,9 +823,11 @@ CPUSearch:
 		sha256_func func;
 		sha256_func func;
 		switch (work_mining_algorithm(work)->algo)
 		switch (work_mining_algorithm(work)->algo)
 		{
 		{
+#ifdef USE_SCRYPT
 			case POW_SCRYPT:
 			case POW_SCRYPT:
 				func = scanhash_scrypt;
 				func = scanhash_scrypt;
 				break;
 				break;
+#endif
 			case POW_SHA256D:
 			case POW_SHA256D:
 				func = sha256_funcs[opt_algo];
 				func = sha256_funcs[opt_algo];
 				break;
 				break;

+ 2 - 0
driver-getwork.c

@@ -202,6 +202,7 @@ int handle_getwork(struct MHD_Connection *conn, bytes_t *upbuf)
 		memcpy(&reply[442], "\",\"hash1\":\"00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000\"},\"id\":", 147);
 		memcpy(&reply[442], "\",\"hash1\":\"00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000\"},\"id\":", 147);
 		memcpy(&reply[589], idstr ?: "0", idstr_sz);
 		memcpy(&reply[589], idstr ?: "0", idstr_sz);
 		memcpy(&reply[589 + idstr_sz], "}", 1);
 		memcpy(&reply[589 + idstr_sz], "}", 1);
+#ifdef USE_SCRYPT
 		if (malgo->algo == POW_SCRYPT)
 		if (malgo->algo == POW_SCRYPT)
 		{
 		{
 			replysz += 21;
 			replysz += 21;
@@ -209,6 +210,7 @@ int handle_getwork(struct MHD_Connection *conn, bytes_t *upbuf)
 			memmove(&reply[443 + 21], &reply[443], replysz - (443 + 21));
 			memmove(&reply[443 + 21], &reply[443], replysz - (443 + 21));
 			memcpy(&reply[443], ",\"algorithm\":\"scrypt\"", 21);
 			memcpy(&reply[443], ",\"algorithm\":\"scrypt\"", 21);
 		}
 		}
+#endif
 		
 		
 		timer_set_now(&work->tv_work_start);
 		timer_set_now(&work->tv_work_start);
 		HASH_ADD_KEYPTR(hh, client->work, work->data, 76, work);
 		HASH_ADD_KEYPTR(hh, client->work, work->data, 76, work);

+ 2 - 0
miner.h

@@ -278,7 +278,9 @@ struct gpu_adl {
 
 
 enum pow_algorithm {
 enum pow_algorithm {
 	POW_SHA256D = 1,
 	POW_SHA256D = 1,
+#ifdef USE_SCRYPT
 	POW_SCRYPT  = 2,
 	POW_SCRYPT  = 2,
+#endif
 };
 };
 
 
 struct api_data;
 struct api_data;