diff --git a/api.c b/api.c index c175fe1c..4caf65c4 100644 --- a/api.c +++ b/api.c @@ -1819,6 +1819,7 @@ static void poolstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m root = api_add_int(root, "POOL", &i, false); root = api_add_string(root, "Name", pool->name, false); + root = api_add_string(root, "Coin", pool->coin, false); root = api_add_escape(root, "URL", pool->rpc_url, false); root = api_add_string(root, "Status", status, false); root = api_add_int(root, "Priority", &(pool->prio), false); diff --git a/miner.h b/miner.h index 8878219e..9761ff23 100644 --- a/miner.h +++ b/miner.h @@ -1172,6 +1172,7 @@ struct stratum_work { struct pool { int pool_no; char *name; + char *coin; int prio; int accepted, rejected; int seq_rejects; diff --git a/sgminer.c b/sgminer.c index b9fd4ce9..59f86582 100644 --- a/sgminer.c +++ b/sgminer.c @@ -554,6 +554,8 @@ struct pool *add_pool(void) pool->quota = 1; adjust_quota_gcd(); + pool->coin = ""; + return pool; } @@ -925,6 +927,16 @@ static char *set_pool_priority(char *arg) return NULL; } +static char *set_pool_coin(char *arg) +{ + struct pool *pool = get_current_pool(); + + applog(LOG_DEBUG, "Setting pool %i coin to %s", pool->pool_no, arg); + opt_set_charp(arg, &pool->coin); + + return NULL; +} + static char *enable_debug(bool *flag) { *flag = true; @@ -1397,6 +1409,9 @@ static struct opt_table opt_config_table[] = { OPT_WITH_ARG("--pool-priority", set_pool_priority, NULL, NULL, "Pool priority"), + OPT_WITH_ARG("--coin", + set_pool_coin, NULL, NULL, + "Pool coin"), OPT_WITHOUT_ARG("--worktime", opt_set_bool, &opt_worktime, "Display extra work time debug information"),