Browse Source

pool: introduce get_pool_user() for simpler opt_incognito use.

Use immediately.
build-mingw
Noel Maersk 11 years ago
parent
commit
934c4f5f14
  1. 6
      pool.c
  2. 2
      pool.h

6
pool.c

@ -29,6 +29,7 @@
#include "config.h" #include "config.h"
#include "miner.h" #include "miner.h"
#include "pool.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
@ -39,3 +40,8 @@ char* get_pool_name(struct pool *pool) {
if (strcmp(pool->poolname, "") == 0) return pool->sockaddr_url; if (strcmp(pool->poolname, "") == 0) return pool->sockaddr_url;
return pool->poolname; return pool->poolname;
} }
char* get_pool_user(struct pool *pool) {
if (opt_incognito) return POOL_USER_INCOGNITO;
return pool->rpc_user;
}

2
pool.h

@ -4,7 +4,9 @@
#include "miner.h" #include "miner.h"
#define POOL_NAME_INCOGNITO "<incognito>" #define POOL_NAME_INCOGNITO "<incognito>"
#define POOL_USER_INCOGNITO "<incognito>"
extern char* get_pool_name(struct pool *pool); extern char* get_pool_name(struct pool *pool);
extern char* get_pool_user(struct pool *pool);
#endif /* POOL_H */ #endif /* POOL_H */

Loading…
Cancel
Save