Browse Source

SGW: Refuse to issue new work to disabled devices

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

+ 6 - 1
driver-getwork.c

@@ -38,7 +38,6 @@ static
 pthread_mutex_t getwork_clients_mutex;
 
 // TODO: X-Hashes-Done?
-// TODO: block getworks if disabled?
 
 static
 void prune_worklog()
@@ -240,6 +239,12 @@ int handle_getwork(struct MHD_Connection *conn, bytes_t *upbuf)
 		goto out;
 	}
 	
+	if (cgpu->deven == DEV_DISABLED)
+	{
+		ret = getwork_error(conn, -10, "Virtual device has been disabled", idstr, idstr_sz);
+		goto out;
+	}
+	
 	{
 		const size_t replysz = 451 + idstr_sz;