Fix --scrypt being required before scrypt intensities on command line or not working at all via config files.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/driver-opencl.c b/driver-opencl.c
index 38995eb..57df2dc 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -550,7 +550,7 @@ char *set_intensity(char *arg)
else {
gpus[device].dynamic = false;
val = atoi(nextptr);
- if (val < MIN_INTENSITY || val > MAX_INTENSITY)
+ if (val < MIN_INTENSITY || val > MAX_GPU_INTENSITY)
return "Invalid value passed to set intensity";
tt = &gpus[device].intensity;
*tt = val;
@@ -564,7 +564,7 @@ char *set_intensity(char *arg)
else {
gpus[device].dynamic = false;
val = atoi(nextptr);
- if (val < MIN_INTENSITY || val > MAX_INTENSITY)
+ if (val < MIN_INTENSITY || val > MAX_GPU_INTENSITY)
return "Invalid value passed to set intensity";
tt = &gpus[device].intensity;
diff --git a/miner.h b/miner.h
index f2cc84b..61a082b 100644
--- a/miner.h
+++ b/miner.h
@@ -958,11 +958,13 @@ extern bool add_pool_details(struct pool *pool, bool live, char *url, char *user
#define MIN_INTENSITY_STR (opt_scrypt ? MIN_SCRYPT_INTENSITY_STR : MIN_SHA_INTENSITY_STR)
#define MAX_INTENSITY (opt_scrypt ? MAX_SCRYPT_INTENSITY : MAX_SHA_INTENSITY)
#define MAX_INTENSITY_STR (opt_scrypt ? MAX_SCRYPT_INTENSITY_STR : MAX_SHA_INTENSITY_STR)
+#define MAX_GPU_INTENSITY MAX_SCRYPT_INTENSITY
#else
#define MIN_INTENSITY MIN_SHA_INTENSITY
#define MIN_INTENSITY_STR MIN_SHA_INTENSITY_STR
#define MAX_INTENSITY MAX_SHA_INTENSITY
#define MAX_INTENSITY_STR MAX_SHA_INTENSITY_STR
+#define MAX_GPU_INTENSITY MAX_SHA_INTENSITY
#endif
extern bool hotplug_mode;