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

api: check if name/desc/algo are NULL and fill with defaults if so.

Defaults should probably be specified elsewhere.
There should be a constructor for stuff like this.
This shit is really bringing me down.
This commit is contained in:
Noel Maersk 2014-04-11 15:27:58 +03:00
parent 9aaff8ccf5
commit 5409ffc2a4

5
api.c
View File

@ -2178,6 +2178,11 @@ static void addpool(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *
return;
}
/* If API client is old, it might not have provided all fields. */
if (name == NULL) name = strdup("");
if (desc == NULL) desc = strdup("");
if (algo == NULL) algo = strdup("scrypt"); // FIXME?
pool = add_pool();
detect_stratum(pool, url);
add_pool_details(pool, true, url, user, pass, name, desc, algo);