|
|
@ -153,7 +153,8 @@ retry: |
|
|
|
keep_sockalive(cs->fd); |
|
|
|
keep_sockalive(cs->fd); |
|
|
|
|
|
|
|
|
|
|
|
/* Test we can connect, authorise and get a block template */ |
|
|
|
/* Test we can connect, authorise and get a block template */ |
|
|
|
gbt = si->data; |
|
|
|
gbt = ckzalloc(sizeof(gbtbase_t)); |
|
|
|
|
|
|
|
si->data = gbt; |
|
|
|
if (!gen_gbtbase(cs, gbt)) { |
|
|
|
if (!gen_gbtbase(cs, gbt)) { |
|
|
|
LOGINFO("Failed to get test block template from %s:%s!", |
|
|
|
LOGINFO("Failed to get test block template from %s:%s!", |
|
|
|
cs->url, cs->port); |
|
|
|
cs->url, cs->port); |
|
|
@ -192,7 +193,6 @@ static void kill_server(server_instance_t *si) |
|
|
|
dealloc(cs->port); |
|
|
|
dealloc(cs->port); |
|
|
|
dealloc(cs->auth); |
|
|
|
dealloc(cs->auth); |
|
|
|
dealloc(si->data); |
|
|
|
dealloc(si->data); |
|
|
|
dealloc(si); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int gen_loop(proc_instance_t *pi) |
|
|
|
static int gen_loop(proc_instance_t *pi) |
|
|
@ -1299,15 +1299,11 @@ static int server_mode(ckpool_t *ckp, proc_instance_t *pi) |
|
|
|
|
|
|
|
|
|
|
|
ckp->servers = ckalloc(sizeof(server_instance_t *) * ckp->btcds); |
|
|
|
ckp->servers = ckalloc(sizeof(server_instance_t *) * ckp->btcds); |
|
|
|
for (i = 0; i < ckp->btcds; i++) { |
|
|
|
for (i = 0; i < ckp->btcds; i++) { |
|
|
|
gbtbase_t *gbt; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ckp->servers[i] = ckzalloc(sizeof(server_instance_t)); |
|
|
|
ckp->servers[i] = ckzalloc(sizeof(server_instance_t)); |
|
|
|
si = ckp->servers[i]; |
|
|
|
si = ckp->servers[i]; |
|
|
|
si->url = ckp->btcdurl[i]; |
|
|
|
si->url = ckp->btcdurl[i]; |
|
|
|
si->auth = ckp->btcdauth[i]; |
|
|
|
si->auth = ckp->btcdauth[i]; |
|
|
|
si->pass = ckp->btcdpass[i]; |
|
|
|
si->pass = ckp->btcdpass[i]; |
|
|
|
gbt = ckzalloc(sizeof(gbtbase_t)); |
|
|
|
|
|
|
|
si->data = gbt; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ret = gen_loop(pi); |
|
|
|
ret = gen_loop(pi); |
|
|
@ -1315,6 +1311,7 @@ static int server_mode(ckpool_t *ckp, proc_instance_t *pi) |
|
|
|
for (i = 0; i < ckp->btcds; i++) { |
|
|
|
for (i = 0; i < ckp->btcds; i++) { |
|
|
|
si = ckp->servers[i]; |
|
|
|
si = ckp->servers[i]; |
|
|
|
kill_server(si); |
|
|
|
kill_server(si); |
|
|
|
|
|
|
|
dealloc(si); |
|
|
|
} |
|
|
|
} |
|
|
|
dealloc(ckp->servers); |
|
|
|
dealloc(ckp->servers); |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|