Browse Source

Merge commit 'd5eb665' into bfgminer

Conflicts:
	driver-icarus.c
Luke Dashjr 14 years ago
parent
commit
d0f3fcfa1f
3 changed files with 7 additions and 4 deletions
  1. 4 4
      api.c
  2. 1 0
      miner.c
  3. 2 0
      miner.h

+ 4 - 4
api.c

@@ -158,7 +158,7 @@ static const char SEPARATOR = '|';
 #define SEPSTR "|"
 #define SEPSTR "|"
 static const char GPUSEP = ',';
 static const char GPUSEP = ',';
 
 
-static const char *APIVERSION = "1.9";
+static const char *APIVERSION = "1.10";
 static const char *DEAD = "Dead";
 static const char *DEAD = "Dead";
 static const char *SICK = "Sick";
 static const char *SICK = "Sick";
 static const char *NOSTART = "NoStart";
 static const char *NOSTART = "NoStart";
@@ -1195,8 +1195,8 @@ static void poolstatus(__maybe_unused SOCKETTYPE c, __maybe_unused char *param,
 		rpc_user = escape_string(pool->rpc_user, isjson);
 		rpc_user = escape_string(pool->rpc_user, isjson);
 
 
 		sprintf(buf, isjson
 		sprintf(buf, isjson
-			? "%s{\"POOL\":%d,\"URL\":\"%s\",\"Status\":\"%s\",\"Priority\":%d,\"Long Poll\":\"%s\",\"Getworks\":%d,\"Accepted\":%d,\"Rejected\":%d,\"Discarded\":%d,\"Stale\":%d,\"Get Failures\":%d,\"Remote Failures\":%d,\"User\":\"%s\"}"
-			: "%sPOOL=%d,URL=%s,Status=%s,Priority=%d,Long Poll=%s,Getworks=%d,Accepted=%d,Rejected=%d,Discarded=%d,Stale=%d,Get Failures=%d,Remote Failures=%d,User=%s" SEPSTR,
+			? "%s{\"POOL\":%d,\"URL\":\"%s\",\"Status\":\"%s\",\"Priority\":%d,\"Long Poll\":\"%s\",\"Getworks\":%d,\"Accepted\":%d,\"Rejected\":%d,\"Discarded\":%d,\"Stale\":%d,\"Get Failures\":%d,\"Remote Failures\":%d,\"User\":\"%s\",\"Last Share Time\":%lu}"
+			: "%sPOOL=%d,URL=%s,Status=%s,Priority=%d,Long Poll=%s,Getworks=%d,Accepted=%d,Rejected=%d,Discarded=%d,Stale=%d,Get Failures=%d,Remote Failures=%d,User=%s,Last Share Time=%lu" SEPSTR,
 			(isjson && (i > 0)) ? COMMA : BLANK,
 			(isjson && (i > 0)) ? COMMA : BLANK,
 			i, rpc_url, status, pool->prio, lp,
 			i, rpc_url, status, pool->prio, lp,
 			pool->getwork_requested,
 			pool->getwork_requested,
@@ -1205,7 +1205,7 @@ static void poolstatus(__maybe_unused SOCKETTYPE c, __maybe_unused char *param,
 			pool->stale_shares,
 			pool->stale_shares,
 			pool->getfail_occasions,
 			pool->getfail_occasions,
 			pool->remotefail_occasions,
 			pool->remotefail_occasions,
-			rpc_user);
+			rpc_user, pool->last_share_time);
 
 
 		strcat(io_buffer, buf);
 		strcat(io_buffer, buf);
 
 

+ 1 - 0
miner.c

@@ -1675,6 +1675,7 @@ static bool submit_upstream_work(const struct work *work, CURL *curl)
 		pool->seq_rejects = 0;
 		pool->seq_rejects = 0;
 		cgpu->last_share_pool = pool->pool_no;
 		cgpu->last_share_pool = pool->pool_no;
 		cgpu->last_share_pool_time = time(NULL);
 		cgpu->last_share_pool_time = time(NULL);
+		pool->last_share_time = cgpu->last_share_pool_time;
 		applog(LOG_DEBUG, "PROOF OF WORK RESULT: true (yay!!!)");
 		applog(LOG_DEBUG, "PROOF OF WORK RESULT: true (yay!!!)");
 		if (!QUIET) {
 		if (!QUIET) {
 			if (total_pools > 1)
 			if (total_pools > 1)

+ 2 - 0
miner.h

@@ -643,6 +643,8 @@ struct pool {
 	int curls;
 	int curls;
 	pthread_cond_t cr_cond;
 	pthread_cond_t cr_cond;
 	struct list_head curlring;
 	struct list_head curlring;
+
+	time_t last_share_time;
 };
 };
 
 
 struct work {
 struct work {