From 8b690b572235cc743e695e20fe433a3a61aaa43a Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 2 Sep 2011 08:55:09 +1000 Subject: [PATCH] Give a verbose message when no active pools are found and pause before exiting. --- main.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 71e66a8f..106c303c 100644 --- a/main.c +++ b/main.c @@ -4961,8 +4961,21 @@ int main (int argc, char *argv[]) } } - if (!pools_active) - quit(0, "No pools active! Exiting."); + if (!pools_active) { + enable_curses(); + applog(LOG_ERR, "No servers were found that could be used to get work from."); + applog(LOG_ERR, "Please check the details from the list below of the servers you have input"); + applog(LOG_ERR, "Most likely you have input the wrong URL, forgotten to add a port, or have not set up workers"); + for (i = 0; i < total_pools; i++) { + struct pool *pool; + + pool = pools[i]; + 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."); + } /* If we want longpoll, enable it for the chosen default pool, or, if * the pool does not support longpoll, find the first one that does