Browse Source

Merge commit '501f4cd' into cg_merges_20130513

Conflicts:
	util.c
Luke Dashjr 12 years ago
parent
commit
a6331eb5f1
1 changed files with 6 additions and 3 deletions
  1. 6 3
      util.c

+ 6 - 3
util.c

@@ -1910,13 +1910,16 @@ bool initiate_stratum(struct pool *pool)
 
 	sockd = true;
 resend:
-	if (!noresume) {
+	if (noresume) {
+		/* Get rid of any crap lying around if we're resending */
+		clear_sock(pool);
+		sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": []}", swork_id++);
+	} else {
 		if (pool->sessionid)
 			sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\""PACKAGE"/"VERSION"\", \"%s\"]}", swork_id++, pool->sessionid);
 		else
 			sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\""PACKAGE"/"VERSION"\"]}", swork_id++);
-	} else
-		sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": []}", swork_id++);
+	}
 
 	if (__stratum_send(pool, s, strlen(s)) != SEND_OK) {
 		applog(LOG_DEBUG, "Failed to send s in initiate_stratum");