1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 12:34:27 +00:00

Implement client.show_message support for stratum.

This commit is contained in:
Con Kolivas 2013-03-07 08:42:14 +11:00
parent 0be6e9e76c
commit e3151799b6

18
util.c
View File

@ -1268,6 +1268,19 @@ static bool send_version(struct pool *pool, json_t *val)
return true;
}
static bool show_message(struct pool *pool, json_t *val)
{
char *msg;
if (!json_is_array(val))
return false;
msg = (char *)json_string_value(json_array_get(val, 0));
if (!msg)
return false;
applog(LOG_NOTICE, "Pool %d message: %s", pool->pool_no, msg);
return true;
}
bool parse_method(struct pool *pool, char *s)
{
json_t *val = NULL, *method, *err_val, *params;
@ -1331,6 +1344,11 @@ bool parse_method(struct pool *pool, char *s)
ret = true;
goto out;
}
if (!strncasecmp(buf, "client.show_message", 19) && show_message(pool, params)) {
ret = true;
goto out;
}
out:
if (val)
json_decref(val);