Added coin field support added in xmrig-proxy 2.5.

This commit is contained in:
XMRig
2018-03-09 00:50:06 +07:00
parent a8b1f84e30
commit 1d6ffa3e8d
3 changed files with 20 additions and 0 deletions

View File

@@ -65,6 +65,7 @@ Job::Job(int poolId, bool nicehash, bool monero) :
m_diff(0),
m_target(0)
{
memset(m_coin, 0, sizeof(m_coin));
}
@@ -148,6 +149,18 @@ bool Job::setTarget(const char *target)
}
void Job::setCoin(const char *coin)
{
if (!coin || strlen(coin) > 4) {
memset(m_coin, 0, sizeof(m_coin));
return;
}
strncpy(m_coin, coin, sizeof(m_coin));
m_monero = strcmp(m_coin, "XMR") == 0;
}
bool Job::fromHex(const char* in, unsigned int len, unsigned char* out)
{
bool error = false;