|
@@ -809,7 +809,7 @@ double tdiff(struct timeval *end, struct timeval *start)
|
|
|
|
|
|
|
|
bool extract_sockaddr(struct pool *pool, char *url)
|
|
bool extract_sockaddr(struct pool *pool, char *url)
|
|
|
{
|
|
{
|
|
|
- char *url_begin, *url_end, *port_start;
|
|
|
|
|
|
|
+ char *url_begin, *url_end, *port_start = NULL;
|
|
|
char *url_address, *port;
|
|
char *url_address, *port;
|
|
|
struct addrinfo hints, *res;
|
|
struct addrinfo hints, *res;
|
|
|
int url_len, port_len = 0;
|
|
int url_len, port_len = 0;
|
|
@@ -854,7 +854,7 @@ bool extract_sockaddr(struct pool *pool, char *url)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pool->server = (struct sockaddr_in *)res->ai_addr;
|
|
pool->server = (struct sockaddr_in *)res->ai_addr;
|
|
|
- pool->stratum_url = strdup(url_address);
|
|
|
|
|
|
|
+ pool->sockaddr_url = strdup(url_address);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1188,7 +1188,7 @@ out:
|
|
|
|
|
|
|
|
bool initiate_stratum(struct pool *pool)
|
|
bool initiate_stratum(struct pool *pool)
|
|
|
{
|
|
{
|
|
|
- json_t *val, *res_val, *err_val, *notify_val;
|
|
|
|
|
|
|
+ json_t *val = NULL, *res_val, *err_val, *notify_val;
|
|
|
char *s, *buf, *sret = NULL;
|
|
char *s, *buf, *sret = NULL;
|
|
|
json_error_t err;
|
|
json_error_t err;
|
|
|
bool ret = false;
|
|
bool ret = false;
|
|
@@ -1281,6 +1281,7 @@ out:
|
|
|
json_decref(val);
|
|
json_decref(val);
|
|
|
|
|
|
|
|
if (ret) {
|
|
if (ret) {
|
|
|
|
|
+ pool->stratum_url = pool->sockaddr_url;
|
|
|
pool->stratum_active = true;
|
|
pool->stratum_active = true;
|
|
|
pool->swork.diff = 1;
|
|
pool->swork.diff = 1;
|
|
|
if (opt_protocol) {
|
|
if (opt_protocol) {
|