summaryrefslogtreecommitdiffstats
path: root/xmrstak/misc
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-10-27 20:37:12 +0100
committerGitHub <noreply@github.com>2017-10-27 20:37:12 +0100
commitc192b97b67bf648540bf058f21b7873bfe886a82 (patch)
treefe71edd305f523021c9038dab5595551c7e4c7e2 /xmrstak/misc
parent91b307859ea97cc1abdb17da01b94919d3521803 (diff)
parent0117ed609e69af977fabaf9c28bbf8cf1300ee89 (diff)
downloadxmr-stak-c192b97b67bf648540bf058f21b7873bfe886a82.zip
xmr-stak-c192b97b67bf648540bf058f21b7873bfe886a82.tar.gz
Merge pull request #67 from psychocrypt/topic-aeon2
add Aeon support
Diffstat (limited to 'xmrstak/misc')
-rw-r--r--xmrstak/misc/executor.cpp21
-rw-r--r--xmrstak/misc/utility.cpp21
-rw-r--r--xmrstak/misc/utility.hpp12
3 files changed, 50 insertions, 4 deletions
diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp
index 7fc46e4..b469dc2 100644
--- a/xmrstak/misc/executor.cpp
+++ b/xmrstak/misc/executor.cpp
@@ -21,6 +21,7 @@
*
*/
+#include "xmrstak/jconf.hpp"
#include "executor.hpp"
#include "xmrstak/net/jpsock.hpp"
@@ -183,8 +184,16 @@ void executor::on_sock_ready(size_t pool_id)
if(pool_id == dev_pool_id)
{
- if(!pool->cmd_login("", ""))
- pool->disconnect();
+ if(::jconf::inst()->IsCurrencyMonero())
+ {
+ if(!pool->cmd_login("", ""))
+ pool->disconnect();
+ }
+ else
+ {
+ if(!pool->cmd_login("WmsvqXDu7Fw5eAEZr1euJH3ycad55NxFd82PfhLR9Zi1Nq5S74zk63EA8fyMS8BQNR94os9N9aah87inKkumNJ7G2d7qTpRLN", "x"))
+ pool->disconnect();
+ }
current_pool_id = dev_pool_id;
printer::inst()->print_msg(L1, "Dev pool logged in. Switching work.");
@@ -352,8 +361,12 @@ void executor::on_switch_pool(size_t pool_id)
// If it fails, it fails, we carry on on the usr pool
// as we never receive further events
printer::inst()->print_msg(L1, "Connecting to dev pool...");
- const char* dev_pool_addr = jconf::inst()->GetTlsSetting() ? "donate.xmr-stak.net:6666" : "donate.xmr-stak.net:3333";
- if(!pool->connect(dev_pool_addr, error))
+ std::string dev_pool_addr;
+ if(::jconf::inst()->IsCurrencyMonero())
+ dev_pool_addr = jconf::inst()->GetTlsSetting() ? "donate.xmr-stak.net:6666" : "donate.xmr-stak.net:3333";
+ else
+ dev_pool_addr = jconf::inst()->GetTlsSetting() ? "mine.aeon-pool.com:443" : "mine.aeon-pool.com:5555";
+ if(!pool->connect(dev_pool_addr.c_str(), error))
printer::inst()->print_msg(L1, "Error connecting to dev pool. Staying with user pool.");
}
else
diff --git a/xmrstak/misc/utility.cpp b/xmrstak/misc/utility.cpp
new file mode 100644
index 0000000..3b1369a
--- /dev/null
+++ b/xmrstak/misc/utility.cpp
@@ -0,0 +1,21 @@
+#include <string>
+#include <algorithm>
+
+
+namespace xmrstak
+{
+ bool strcmp_i(const std::string& str1, const std::string& str2)
+ {
+ if(str1.size() != str2.size())
+ return false;
+ else
+ return (str1.empty() | str2.empty()) ?
+ false :
+ std::equal(str1.begin(), str1.end(),str2.begin(),
+ [](char c1, char c2)
+ {
+ return ::tolower(c1) == ::tolower(c2);
+ }
+ );
+ }
+} // namepsace xmrstak
diff --git a/xmrstak/misc/utility.hpp b/xmrstak/misc/utility.hpp
new file mode 100644
index 0000000..b2e841d
--- /dev/null
+++ b/xmrstak/misc/utility.hpp
@@ -0,0 +1,12 @@
+#pragma once
+
+#include <string>
+
+namespace xmrstak
+{
+ /** case insensitive string compare
+ *
+ * @return true if both strings are equal, else false
+ */
+ bool strcmp_i(const std::string& str1, const std::string& str2);
+} // namepsace xmrstak
OpenPOWER on IntegriCloud