Add timestamps to stratum_share structs as they're generated and copy the stratum sessionid if it exists to stratum work generated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/cgminer.c b/cgminer.c
index a023e8b..1192072 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -240,6 +240,7 @@ struct stratum_share {
bool block;
struct work *work;
int id;
+ time_t sshare_time;
};
static struct stratum_share *stratum_shares = NULL;
@@ -3152,6 +3153,7 @@ static void *submit_work_thread(void *userdata)
char *noncehex;
char s[1024];
+ sshare->sshare_time = time(NULL);
/* This work item is freed in parse_stratum_response */
sshare->work = work;
mutex_lock(&sshare_lock);
@@ -5159,7 +5161,8 @@ static void gen_stratum_work(struct pool *pool, struct work *work)
/* Copy parameters required for share submission */
work->job_id = strdup(pool->swork.job_id);
work->ntime = strdup(pool->swork.ntime);
-
+ if (pool->sessionid)
+ work->sessionid = strdup(pool->sessionid);
mutex_unlock(&pool->pool_lock);
applog(LOG_DEBUG, "Generated stratum merkle %s", merkle_hash);
diff --git a/miner.h b/miner.h
index 4523302..689e76d 100644
--- a/miner.h
+++ b/miner.h
@@ -1006,6 +1006,7 @@ struct work {
char *nonce2;
char *ntime;
double sdiff;
+ char *sessionid;
bool gbt;
char *gbt_coinbase;