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:
parent
9aaff8ccf5
commit
5409ffc2a4
5
api.c
5
api.c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user