summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xmrstak/misc/executor.cpp6
-rw-r--r--xmrstak/net/jpsock.cpp3
2 files changed, 5 insertions, 4 deletions
diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp
index dea1dab..ff5e94f 100644
--- a/xmrstak/misc/executor.cpp
+++ b/xmrstak/misc/executor.cpp
@@ -234,7 +234,7 @@ void executor::eval_pool_choice()
/* All is good - but check if we can do better */
std::sort(eval_pools.begin(), eval_pools.end(), [](jpsock* a, jpsock* b) { return b->get_pool_weight(false) < a->get_pool_weight(false); });
jpsock* goal2 = eval_pools[0];
-
+
if(goal->get_pool_id() != goal2->get_pool_id())
{
if(!goal2->is_running() && goal2->can_connect())
@@ -252,10 +252,10 @@ void executor::eval_pool_choice()
{
for(jpsock& pool : pools)
{
- if(goal->is_logged_in() && pool.is_running() && pool.get_pool_id() != goal->get_pool_id())
+ if(goal->is_logged_in() && pool.is_logged_in() && pool.get_pool_id() != goal->get_pool_id())
pool.disconnect(true);
- if(pool.is_dev_pool() && pool.is_running())
+ if(pool.is_dev_pool() && pool.is_logged_in())
pool.disconnect(true);
}
}
diff --git a/xmrstak/net/jpsock.cpp b/xmrstak/net/jpsock.cpp
index 36c901e..7ee09e7 100644
--- a/xmrstak/net/jpsock.cpp
+++ b/xmrstak/net/jpsock.cpp
@@ -443,16 +443,17 @@ bool jpsock::connect(std::string& sConnectError)
sSocketError.clear();
iJobDiff = 0;
connect_attempts++;
+ connect_time = get_timestamp();
if(sck->set_hostname(net_addr.c_str()))
{
bRunning = true;
disconnect_time = 0;
- connect_time = get_timestamp();
oRecvThd = new std::thread(&jpsock::jpsock_thread, this);
return true;
}
+ disconnect_time = get_timestamp();
sConnectError = std::move(sSocketError);
return false;
}
OpenPOWER on IntegriCloud