Browse Source

SGW: Respond with stale rejection if share is known to be immediately stale

Luke Dashjr 12 years ago
parent
commit
bb7202dab6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      driver-getwork.c

+ 3 - 1
driver-getwork.c

@@ -39,7 +39,6 @@ pthread_mutex_t getwork_clients_mutex;
 
 // TODO: X-Hashes-Done?
 // TODO: block getworks if disabled?
-// TODO: maybe reject known-stale shares?
 
 static
 void prune_worklog()
@@ -217,6 +216,9 @@ int handle_getwork(struct MHD_Connection *conn, bytes_t *upbuf)
 		{
 			if (!submit_nonce(thr, work, nonce))
 				rejreason = "H-not-zero";
+			else
+			if (stale_work(work, true))
+				rejreason = "stale";
 			else
 				rejreason = NULL;