Added classes IThread, CpuThread and API endpoint "GET /1/threads".

This commit is contained in:
XMRig 2018-04-01 22:49:21 +07:00
parent 44d56393db
commit a042cbf885
19 changed files with 320 additions and 78 deletions

View file

@ -59,7 +59,7 @@ static inline char hf_bin2hex(unsigned char c)
Job::Job() :
m_nicehash(false),
m_coin(),
m_algo(xmrig::ALGO_CRYPTONIGHT),
m_algo(xmrig::CRYPTONIGHT),
m_poolId(-2),
m_threadId(-1),
m_variant(xmrig::VARIANT_AUTO),
@ -164,7 +164,7 @@ void Job::setCoin(const char *coin)
}
strncpy(m_coin, coin, sizeof(m_coin));
m_algo = strcmp(m_coin, "AEON") == 0 ? xmrig::ALGO_CRYPTONIGHT_LITE : xmrig::ALGO_CRYPTONIGHT;
m_algo = strcmp(m_coin, "AEON") == 0 ? xmrig::CRYPTONIGHT_LITE : xmrig::CRYPTONIGHT;
}

View file

@ -41,7 +41,7 @@ Url::Url() :
m_host(nullptr),
m_password(nullptr),
m_user(nullptr),
m_algo(xmrig::ALGO_CRYPTONIGHT),
m_algo(xmrig::CRYPTONIGHT),
m_keepAlive(0),
m_variant(xmrig::VARIANT_AUTO),
m_url(nullptr),
@ -66,7 +66,7 @@ Url::Url(const char *url) :
m_host(nullptr),
m_password(nullptr),
m_user(nullptr),
m_algo(xmrig::ALGO_CRYPTONIGHT),
m_algo(xmrig::CRYPTONIGHT),
m_keepAlive(0),
m_variant(xmrig::VARIANT_AUTO),
m_url(nullptr),
@ -80,7 +80,7 @@ Url::Url(const char *host, uint16_t port, const char *user, const char *password
m_nicehash(nicehash),
m_password(password ? strdup(password) : nullptr),
m_user(user ? strdup(user) : nullptr),
m_algo(xmrig::ALGO_CRYPTONIGHT),
m_algo(xmrig::CRYPTONIGHT),
m_keepAlive(keepAlive),
m_variant(variant),
m_url(nullptr),

View file

@ -59,7 +59,7 @@ DonateStrategy::DonateStrategy(int level, const char *user, int algo, IStrategyL
keccak(reinterpret_cast<const uint8_t *>(user), static_cast<int>(strlen(user)), hash, sizeof(hash));
Job::toHex(hash, 32, userId);
if (algo == xmrig::ALGO_CRYPTONIGHT) {
if (algo == xmrig::CRYPTONIGHT) {
m_pools.push_back(new Url(kDonatePool1, 6666, userId, nullptr, false, true));
m_pools.push_back(new Url(kDonatePool1, 80, userId, nullptr, false, true));
m_pools.push_back(new Url(kDonatePool2, 5555, "48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD", "emergency", false, false));