summaryrefslogtreecommitdiffstats
path: root/executor.cpp
diff options
context:
space:
mode:
authorfireice-uk <fireice2@o2.pl>2017-02-12 14:14:27 +0000
committerfireice-uk <fireice2@o2.pl>2017-02-12 14:14:27 +0000
commit1b4f0dd57be74bcd5e724d7910243a5c6712e7d8 (patch)
treec8cf3f4560809a53718fa3fabe88e0a9aa509aa2 /executor.cpp
parent433db1917e95568d56802d73213a1f4ab6782a0c (diff)
downloadxmr-stak-1b4f0dd57be74bcd5e724d7910243a5c6712e7d8.zip
xmr-stak-1b4f0dd57be74bcd5e724d7910243a5c6712e7d8.tar.gz
Giveup limit
Diffstat (limited to 'executor.cpp')
-rw-r--r--executor.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/executor.cpp b/executor.cpp
index aa9588d..7697a2f 100644
--- a/executor.cpp
+++ b/executor.cpp
@@ -96,8 +96,17 @@ void executor::ex_clock_thd()
void executor::sched_reconnect()
{
+ iReconnectAttempts++;
+ size_t iLimit = jconf::inst()->GetGiveUpLimit();
+ if(iLimit != 0 && iReconnectAttempts > iLimit)
+ {
+ printer::inst()->print_msg(L0, "Give up limit reached. Exitting.");
+ exit(0);
+ }
+
long long unsigned int rt = jconf::inst()->GetNetRetry();
- printer::inst()->print_msg(L1, "Pool connection lost. Waiting %lld s before retry.", rt);
+ printer::inst()->print_msg(L1, "Pool connection lost. Waiting %lld s before retry (attempt %llu).",
+ rt, int_port(iReconnectAttempts));
auto work = minethd::miner_work();
minethd::switch_work(work);
@@ -178,7 +187,10 @@ void executor::on_sock_ready(size_t pool_id)
}
}
else
+ {
+ iReconnectAttempts = 0;
reset_stats();
+ }
}
void executor::on_sock_error(size_t pool_id, std::string&& sError)
OpenPOWER on IntegriCloud