mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 13:04:29 +00:00
Write pools in priority order
This commit is contained in:
parent
d594aaf80f
commit
57fa2be13b
20
cgminer.c
20
cgminer.c
@ -2694,15 +2694,21 @@ void remove_pool(struct pool *pool)
|
|||||||
|
|
||||||
void write_config(FILE *fcfg)
|
void write_config(FILE *fcfg)
|
||||||
{
|
{
|
||||||
int i;
|
int i = 0;
|
||||||
|
int j = 0;
|
||||||
|
|
||||||
/* Write pool values */
|
/* Write pool values in priority order */
|
||||||
fputs("{\n\"pools\" : [", fcfg);
|
fputs("{\n\"pools\" : [", fcfg);
|
||||||
for(i = 0; i < total_pools; i++) {
|
while((j < total_pools) && (i < total_pools)) {
|
||||||
fprintf(fcfg, "%s\n\t{\n\t\t\"url\" : \"%s\",", i > 0 ? "," : "", pools[i]->rpc_url);
|
if(pools[i]->prio == j) {
|
||||||
fprintf(fcfg, "\n\t\t\"user\" : \"%s\",", pools[i]->rpc_user);
|
fprintf(fcfg, "%s\n\t{\n\t\t\"url\" : \"%s\",", i > 0 ? "," : "", pools[i]->rpc_url);
|
||||||
fprintf(fcfg, "\n\t\t\"pass\" : \"%s\"\n\t}", pools[i]->rpc_pass);
|
fprintf(fcfg, "\n\t\t\"user\" : \"%s\",", pools[i]->rpc_user);
|
||||||
}
|
fprintf(fcfg, "\n\t\t\"pass\" : \"%s\"\n\t}", pools[i]->rpc_pass);
|
||||||
|
j++;
|
||||||
|
i=0;
|
||||||
|
} else
|
||||||
|
i++;
|
||||||
|
}
|
||||||
fputs("\n]\n", fcfg);
|
fputs("\n]\n", fcfg);
|
||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user