diff options
Diffstat (limited to 'xmrstak/misc')
-rw-r--r-- | xmrstak/misc/console.cpp | 9 | ||||
-rw-r--r-- | xmrstak/misc/executor.cpp | 21 |
2 files changed, 21 insertions, 9 deletions
diff --git a/xmrstak/misc/console.cpp b/xmrstak/misc/console.cpp index 8de5948..980760e 100644 --- a/xmrstak/misc/console.cpp +++ b/xmrstak/misc/console.cpp @@ -222,8 +222,13 @@ void printer::print_str(const char* str) #ifdef _WIN32 void win_exit(size_t code) { - printer::inst()->print_str("Press any key to exit."); - get_key(); + size_t envSize = 0; + getenv_s(&envSize, nullptr, 0, "XMRSTAK_NOWAIT"); + if(envSize == 0) + { + printer::inst()->print_str("Press any key to exit."); + get_key(); + } std::exit(code); } diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp index cccfca7..c500b21 100644 --- a/xmrstak/misc/executor.cpp +++ b/xmrstak/misc/executor.cpp @@ -388,10 +388,16 @@ void executor::on_pool_have_job(size_t pool_id, pool_job& oPoolJob) if(dat.pool_id != pool_id) { - if(dat.pool_id == invalid_pool_id) - printer::inst()->print_msg(L2, "Pool logged in."); + jpsock* prev_pool; + if(dat.pool_id != invalid_pool_id && (prev_pool = pick_pool_by_id(dat.pool_id)) != nullptr) + { + if(prev_pool->is_dev_pool()) + printer::inst()->print_msg(L2, "Switching back to user pool."); + else + printer::inst()->print_msg(L2, "Pool switched."); + } else - printer::inst()->print_msg(L2, "Pool switched."); + printer::inst()->print_msg(L2, "Pool logged in."); } else printer::inst()->print_msg(L3, "New block detected."); @@ -459,6 +465,7 @@ void executor::on_miner_result(size_t pool_id, job_result& oResult) void disable_sigpipe() { struct sigaction sa; + memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_IGN; sa.sa_flags = 0; if (sigaction(SIGPIPE, &sa, 0) == -1) @@ -624,11 +631,11 @@ inline const char* hps_format(double h, char* buf, size_t l) { if(std::isnormal(h) || h == 0.0) { - snprintf(buf, l, " %03.1f", h); + snprintf(buf, l, " %6.1f", h); return buf; } else - return " (na)"; + return " (na)"; } bool executor::motd_filter_console(std::string& motd) @@ -722,9 +729,9 @@ void executor::hashrate_report(std::string& out) std::transform(name.begin(), name.end(), name.begin(), ::toupper); out.append("HASHRATE REPORT - ").append(name).append("\n"); - out.append("| ID | 10s | 60s | 15m |"); + out.append("| ID | 10s | 60s | 15m |"); if(nthd != 1) - out.append(" ID | 10s | 60s | 15m |\n"); + out.append(" ID | 10s | 60s | 15m |\n"); else out.append(1, '\n'); |