mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 01:44:23 +00:00
core: rename default_algorithm to opt_algorithm.
... So it's easier to find when refactoring the configuration system later on.
This commit is contained in:
parent
0793c96074
commit
3ddf6baad9
@ -1188,7 +1188,7 @@ static void opencl_detect(bool hotplug)
|
||||
cgpu->threads = 1;
|
||||
#endif
|
||||
cgpu->virtual_gpu = i;
|
||||
cgpu->algorithm = *default_algorithm;
|
||||
cgpu->algorithm = *opt_algorithm;
|
||||
add_cgpu(cgpu);
|
||||
}
|
||||
|
||||
|
2
miner.h
2
miner.h
@ -1015,7 +1015,7 @@ extern int opt_queue;
|
||||
extern int opt_scantime;
|
||||
extern int opt_expiry;
|
||||
|
||||
extern algorithm_t *default_algorithm;
|
||||
extern algorithm_t *opt_algorithm;
|
||||
|
||||
extern cglock_t control_lock;
|
||||
extern pthread_mutex_t hash_lock;
|
||||
|
1
ocl.h
1
ocl.h
@ -37,4 +37,3 @@ extern int clDevicesNum(void);
|
||||
extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *algorithm);
|
||||
|
||||
#endif /* OCL_H */
|
||||
|
||||
|
20
sgminer.c
20
sgminer.c
@ -98,7 +98,7 @@ int opt_queue = 1;
|
||||
int opt_scantime = 7;
|
||||
int opt_expiry = 28;
|
||||
|
||||
algorithm_t *default_algorithm;
|
||||
algorithm_t *opt_algorithm;
|
||||
|
||||
static const bool opt_time = true;
|
||||
unsigned long long global_hashrate;
|
||||
@ -543,7 +543,7 @@ struct pool *add_pool(void)
|
||||
pool->name = strdup(buf);
|
||||
|
||||
/* Algorithm */
|
||||
pool->algorithm = *default_algorithm;
|
||||
pool->algorithm = *opt_algorithm;
|
||||
|
||||
pools = (struct pool **)realloc(pools, sizeof(struct pool *) * (total_pools + 2));
|
||||
pools[total_pools++] = pool;
|
||||
@ -1070,17 +1070,17 @@ static void load_temp_cutoffs()
|
||||
|
||||
static char *set_algo(const char *arg)
|
||||
{
|
||||
set_algorithm(default_algorithm, arg);
|
||||
applog(LOG_INFO, "Set default algorithm to %s", default_algorithm->name);
|
||||
set_algorithm(opt_algorithm, arg);
|
||||
applog(LOG_INFO, "Set default algorithm to %s", opt_algorithm->name);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char *set_nfactor(const char *arg)
|
||||
{
|
||||
set_algorithm_nfactor(default_algorithm, (const uint8_t) atoi(arg));
|
||||
set_algorithm_nfactor(opt_algorithm, (const uint8_t) atoi(arg));
|
||||
applog(LOG_INFO, "Set algorithm N-factor to %d (N to %d)",
|
||||
default_algorithm->nfactor, default_algorithm->n);
|
||||
opt_algorithm->nfactor, opt_algorithm->n);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -4456,8 +4456,8 @@ void write_config(FILE *fcfg)
|
||||
}
|
||||
if (opt_removedisabled)
|
||||
fprintf(fcfg, ",\n\"remove-disabled\" : true");
|
||||
if (strcmp(default_algorithm->name, "scrypt") != 0)
|
||||
fprintf(fcfg, ",\n\"algorithm\" : \"%s\"", json_escape(default_algorithm->name));
|
||||
if (strcmp(opt_algorithm->name, "scrypt") != 0)
|
||||
fprintf(fcfg, ",\n\"algorithm\" : \"%s\"", json_escape(opt_algorithm->name));
|
||||
if (opt_api_allow)
|
||||
fprintf(fcfg, ",\n\"api-allow\" : \"%s\"", json_escape(opt_api_allow));
|
||||
if (strcmp(opt_api_mcast_addr, API_MCAST_ADDR) != 0)
|
||||
@ -7985,8 +7985,8 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
/* Default algorithm specified in algorithm.c ATM */
|
||||
default_algorithm = (algorithm_t *)alloca(sizeof(algorithm_t));
|
||||
set_algorithm(default_algorithm, "scrypt");
|
||||
opt_algorithm = (algorithm_t *)alloca(sizeof(algorithm_t));
|
||||
set_algorithm(opt_algorithm, "scrypt");
|
||||
|
||||
devcursor = 8;
|
||||
logstart = devcursor + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user