Commit c851f3959894379b213cd81ecbf8317b2ad4f313

Con Kolivas 2013-02-15T14:46:30

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

diff --git a/miner.h b/miner.h
index e9982b7..4523302 100644
--- a/miner.h
+++ b/miner.h
@@ -941,6 +941,7 @@ struct pool {
 	size_t n1_len;
 	uint32_t nonce2;
 	int n2size;
+	char *sessionid;
 	bool has_stratum;
 	bool stratum_active;
 	bool stratum_auth;
diff --git a/util.c b/util.c
index 4d2d7d9..3ab1236 100644
--- a/util.c
+++ b/util.c
@@ -1478,6 +1478,11 @@ bool initiate_stratum(struct pool *pool)
 		applog(LOG_INFO, "Failed to get n2size in initiate_stratum");
 		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;
 out: