summaryrefslogtreecommitdiffstats
path: root/xmrstak
diff options
context:
space:
mode:
authorUnknown <fireice2@o2.pl>2017-11-16 13:22:49 +0000
committerfireice-uk <fireice2@o2.pl>2017-11-16 16:14:00 +0000
commit0a20956b3f44a41566be18b55f47d96935b01202 (patch)
tree6dc83776504cf3eab752b566503638fdb65ac901 /xmrstak
parent036ffa887272b0c27197f78a6082b903ace1a344 (diff)
downloadxmr-stak-0a20956b3f44a41566be18b55f47d96935b01202.zip
xmr-stak-0a20956b3f44a41566be18b55f47d96935b01202.tar.gz
Fix cases where postive feedback was still occurring.
Diffstat (limited to 'xmrstak')
-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