Browse Source

Avoid retrying longpoll requests for removed pools (and possibly change block change notification source for existing ones) if longpoll connection gets dropped

Luke Dashjr 11 years ago
parent
commit
e8840ffe84
1 changed files with 6 additions and 5 deletions
  1. 6 5
      miner.c

+ 6 - 5
miner.c

@@ -9929,12 +9929,13 @@ retry_pool:
 			 * time. */
 			 * time. */
 			cgtime(&end);
 			cgtime(&end);
 			free_work(work);
 			free_work(work);
-			if (end.tv_sec - start.tv_sec > 30)
-				continue;
-			if (failures == 1)
-				applog(LOG_WARNING, "longpoll failed for %s, retrying every 30s", lp_url);
+			if (end.tv_sec - start.tv_sec <= 30)
+			{
+				if (failures == 1)
+					applog(LOG_WARNING, "longpoll failed for %s, retrying every 30s", lp_url);
 lpfail:
 lpfail:
-			cgsleep_ms(30000);
+				cgsleep_ms(30000);
+			}
 		}
 		}
 
 
 		if (pool != cp) {
 		if (pool != cp) {