mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
config: write algorithm
to config if not default.
Closes https://github.com/veox/sgminer/issues/175
This commit is contained in:
parent
27e4515b9a
commit
08ff1574df
@ -1096,7 +1096,7 @@ static char *set_null(const char __maybe_unused *arg)
|
|||||||
static struct opt_table opt_config_table[] = {
|
static struct opt_table opt_config_table[] = {
|
||||||
OPT_WITH_ARG("--algorithm",
|
OPT_WITH_ARG("--algorithm",
|
||||||
set_algo, NULL, NULL,
|
set_algo, NULL, NULL,
|
||||||
"Set mining algorithm and most common defaults, default: static"),
|
"Set mining algorithm and most common defaults, default: scrypt"),
|
||||||
OPT_WITH_ARG("--api-allow",
|
OPT_WITH_ARG("--api-allow",
|
||||||
set_api_allow, NULL, NULL,
|
set_api_allow, NULL, NULL,
|
||||||
"Allow API access only to the given list of [G:]IP[/Prefix] addresses[/subnets]"),
|
"Allow API access only to the given list of [G:]IP[/Prefix] addresses[/subnets]"),
|
||||||
@ -4411,6 +4411,8 @@ void write_config(FILE *fcfg)
|
|||||||
}
|
}
|
||||||
if (opt_removedisabled)
|
if (opt_removedisabled)
|
||||||
fprintf(fcfg, ",\n\"remove-disabled\" : true");
|
fprintf(fcfg, ",\n\"remove-disabled\" : true");
|
||||||
|
if (strcmp(algorithm->name, "scrypt") != 0)
|
||||||
|
fprintf(fcfg, ",\n\"algorithm\" : \"%s\"", json_escape(algorithm->name));
|
||||||
if (opt_api_allow)
|
if (opt_api_allow)
|
||||||
fprintf(fcfg, ",\n\"api-allow\" : \"%s\"", json_escape(opt_api_allow));
|
fprintf(fcfg, ",\n\"api-allow\" : \"%s\"", json_escape(opt_api_allow));
|
||||||
if (strcmp(opt_api_mcast_addr, API_MCAST_ADDR) != 0)
|
if (strcmp(opt_api_mcast_addr, API_MCAST_ADDR) != 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user