Display URL connected to and user connected as in status.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/main.c b/main.c
index 7e8fd67..e8f421b 100644
--- a/main.c
+++ b/main.c
@@ -571,8 +571,10 @@ static void curses_print_status(int thr_id)
local_work, localgen_occasions, remotefail_occasions, scan_intensity);
wclrtoeol(statuswin);
wmove(statuswin, 4, 0);
- wprintw(statuswin, " Block %s started: %s", current_block + 4, blockdate);
+ wprintw(statuswin, " Connected to %s as user %s", rpc_url, rpc_user);
wmove(statuswin, 5, 0);
+ wprintw(statuswin, " Block %s started: %s", current_block + 4, blockdate);
+ wmove(statuswin, 6, 0);
whline(statuswin, '-', 80);
wmove(statuswin, logstart - 1, 0);
whline(statuswin, '-', 80);
@@ -2192,7 +2194,7 @@ int main (int argc, char *argv[])
opt_n_threads = num_processors;
}
- logcursor = 6;
+ logcursor = 7;
mining_threads = opt_n_threads + gpu_threads;
gpucursor = logcursor;
cpucursor = gpucursor + nDevs;
@@ -2208,6 +2210,16 @@ int main (int argc, char *argv[])
if (!rpc_userpass)
return 1;
sprintf(rpc_userpass, "%s:%s", rpc_user, rpc_pass);
+ } else {
+ rpc_user = malloc(strlen(rpc_userpass));
+ if (!rpc_user)
+ return 1;
+ strcpy(rpc_user, rpc_userpass);
+ rpc_user = strtok(rpc_user, ":");
+ if (!rpc_user) {
+ applog(LOG_ERR, "Failed to find colon delimiter in userpass");
+ return 1;
+ }
}
if (unlikely(curl_global_init(CURL_GLOBAL_ALL)))