Browse Source

config: handle ints, reals and false

master
Tanguy Pruvot 10 years ago
parent
commit
0317706464
  1. 3
      README.txt
  2. 16
      cpu-miner.c
  3. 4
      example-cfg.json

3
README.txt

@ -155,11 +155,12 @@ features. @@ -155,11 +155,12 @@ features.
>>> RELEASE HISTORY <<<
Nov. 11th 2014 v1.4.7
Average hashrate (based on the 50 last scans)
Average hashrate (based on the 20 last scans)
Rewrite blake algo
Add the -i (gpu threads/intensity parameter)
Add some X11 optimisations based on sp_ commits
Fix quark reported hashrate and benchmark mode for some algos
Enhance json config file param (int/float/false) (-c config.json)
Update windows prebuilt curl to 7.38.0
Oct. 26th 2014 v1.4.6

16
cpu-miner.c

@ -1853,11 +1853,23 @@ static void parse_config(void) @@ -1853,11 +1853,23 @@ static void parse_config(void)
char *s = strdup(json_string_value(val));
if (!s)
break;
// applog(LOG_DEBUG, "%s -%c %s", options[i].name, options[i].val, s);
parse_arg(options[i].val, s);
free(s);
} else if (!options[i].has_arg && json_is_true(val))
}
else if (options[i].has_arg && json_is_integer(val)) {
char buf[16];
sprintf(buf, "%d", json_integer_value(val));
parse_arg(options[i].val, buf);
}
else if (options[i].has_arg && json_is_real(val)) {
char buf[16];
sprintf(buf, "%f", json_real_value(val));
parse_arg(options[i].val, buf);
}
else if (!options[i].has_arg) {
if (json_is_true(val))
parse_arg(options[i].val, "");
}
else
applog(LOG_ERR, "JSON option %s invalid",
options[i].name);

4
example-cfg.json

@ -2,8 +2,10 @@ @@ -2,8 +2,10 @@
"_comment" : "todo: support /* comments */",
"algo" : "blake",
"intensity": 19,
"diff": 0.5,
"_quiet" : true,
"quiet" : false,
"url" : "stratum+tcp://www.hashharder.com:9585",
"user" : "NaEcVrdzoCWHUYXb7X8QoafoKS9UV69Yk4",

Loading…
Cancel
Save