mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-29 16:04:33 +00:00
Look for null values and parse correct separate array entries for url and port with client reconnect commands for stratum.
This commit is contained in:
parent
7c04a00e62
commit
5226a399c7
13
util.c
13
util.c
@ -1099,13 +1099,20 @@ static bool parse_diff(struct pool *pool, json_t *val)
|
|||||||
|
|
||||||
static bool parse_reconnect(struct pool *pool, json_t *val)
|
static bool parse_reconnect(struct pool *pool, json_t *val)
|
||||||
{
|
{
|
||||||
char *url;
|
char *url, *port, address[256];
|
||||||
|
|
||||||
|
memset(address, 0, 255);
|
||||||
url = (char *)json_string_value(json_array_get(val, 0));
|
url = (char *)json_string_value(json_array_get(val, 0));
|
||||||
if (!url)
|
if (!url)
|
||||||
return false;
|
url = pool->sockaddr_url;
|
||||||
|
|
||||||
if (!extract_sockaddr(pool, url))
|
port = (char *)json_string_value(json_array_get(val, 1));
|
||||||
|
if (!port)
|
||||||
|
port = pool->stratum_port;
|
||||||
|
|
||||||
|
sprintf(address, "%s:%s", url, port);
|
||||||
|
|
||||||
|
if (!extract_sockaddr(pool, address))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
pool->stratum_url = pool->sockaddr_url;
|
pool->stratum_url = pool->sockaddr_url;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user