Browse Source

Store session id for stratum if the pool supports it for future mining.resume support.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
c851f39598
  1. 1
      miner.h
  2. 5
      util.c

1
miner.h

@ -941,6 +941,7 @@ struct pool {
size_t n1_len; size_t n1_len;
uint32_t nonce2; uint32_t nonce2;
int n2size; int n2size;
char *sessionid;
bool has_stratum; bool has_stratum;
bool stratum_active; bool stratum_active;
bool stratum_auth; bool stratum_auth;

5
util.c

@ -1478,6 +1478,11 @@ bool initiate_stratum(struct pool *pool)
applog(LOG_INFO, "Failed to get n2size in initiate_stratum"); applog(LOG_INFO, "Failed to get n2size in initiate_stratum");
goto out; goto out;
} }
pool->sessionid = json_array_string(res_val, 3);
if (pool->sessionid)
applog(LOG_DEBUG, "Pool %d stratum session id: %s", pool->pool_no, pool->sessionid);
else
applog(LOG_DEBUG, "Pool %d stratum session id does not exist");
ret = true; ret = true;
out: out:

Loading…
Cancel
Save