From 3e527c6af5b07f4d2251e6fc64d9ea550665c7d0 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 30 Sep 2011 17:15:40 +1000 Subject: [PATCH] Retry pools after a delay of 15 seconds if none can be contacted on startup unless a key is pressed. --- main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index cdbd8048..91197d41 100644 --- a/main.c +++ b/main.c @@ -5569,6 +5569,7 @@ int main (int argc, char *argv[]) /* We use the getq mutex as the staged lock */ stgd_lock = &getq->mutex; +retry_pools: /* Test each pool to see if we can retrieve and use work and for what * it supports */ for (i = 0; i < total_pools; i++) { @@ -5601,8 +5602,12 @@ int main (int argc, char *argv[]) applog(LOG_WARNING, "Pool: %d URL: %s User: %s Password: %s", i, pool->rpc_url, pool->rpc_user, pool->rpc_pass); } - curses_input("Press enter to exit"); - quit(0, "No servers could be used! Exiting."); + halfdelay(150); + applog(LOG_ERR, "Press any key to exit, or cgminer will try again in 15s."); + if (getch() != ERR) + quit(0, "No servers could be used! Exiting."); + nocbreak(); + goto retry_pools; } if (opt_donation > 0.0) {