Merge xmrig v6.14.0 into master

This commit is contained in:
MoneroOcean 2021-08-10 14:32:19 +00:00
commit 74f39ac947
47 changed files with 6885 additions and 170 deletions

View file

@ -43,7 +43,7 @@ class JobResult
public:
JobResult() = delete;
inline JobResult(const Job &job, uint64_t nonce, const uint8_t *result, const uint8_t* header_hash = nullptr, const uint8_t *mix_hash = nullptr) :
inline JobResult(const Job &job, uint64_t nonce, const uint8_t *result, const uint8_t* header_hash = nullptr, const uint8_t *mix_hash = nullptr, const uint8_t* miner_signature = nullptr) :
algorithm(job.algorithm()),
clientId(job.clientId()),
jobId(job.id()),
@ -61,6 +61,11 @@ public:
if (mix_hash) {
memcpy(m_mixHash, mix_hash, sizeof(m_mixHash));
}
if (miner_signature) {
m_hasMinerSignature = true;
memcpy(m_minerSignature, miner_signature, sizeof(m_minerSignature));
}
}
inline JobResult(const Job &job) :
@ -80,6 +85,8 @@ public:
inline const uint8_t *headerHash() const { return m_headerHash; }
inline const uint8_t *mixHash() const { return m_mixHash; }
inline const uint8_t *minerSignature() const { return m_hasMinerSignature ? m_minerSignature : nullptr; }
const Algorithm algorithm;
const String clientId;
const String jobId;
@ -92,6 +99,9 @@ private:
uint8_t m_result[32] = { 0 };
uint8_t m_headerHash[32] = { 0 };
uint8_t m_mixHash[32] = { 0 };
uint8_t m_minerSignature[64] = { 0 };
bool m_hasMinerSignature = false;
};

View file

@ -341,6 +341,12 @@ void xmrig::JobResults::submit(const Job &job, uint32_t nonce, const uint8_t *re
}
void xmrig::JobResults::submit(const Job& job, uint32_t nonce, const uint8_t* result, const uint8_t* miner_signature)
{
submit(JobResult(job, nonce, result, nullptr, nullptr, miner_signature));
}
void xmrig::JobResults::submit(const JobResult &result)
{
assert(handler != nullptr);

View file

@ -46,6 +46,7 @@ public:
static void setListener(IJobResultListener *listener, bool hwAES);
static void stop();
static void submit(const Job &job, uint32_t nonce, const uint8_t *result);
static void submit(const Job& job, uint32_t nonce, const uint8_t* result, const uint8_t* miner_signature);
static void submit(const JobResult &result);
# if defined(XMRIG_FEATURE_OPENCL) || defined(XMRIG_FEATURE_CUDA)

View file

@ -137,9 +137,14 @@ void xmrig::Network::onActive(IStrategy *strategy, IClient *client)
}
# endif
char zmq_buf[32] = {};
if (client->pool().zmq_port() >= 0) {
snprintf(zmq_buf, sizeof(zmq_buf), " (ZMQ:%d)", client->pool().zmq_port());
}
const char *tlsVersion = client->tlsVersion();
LOG_INFO("%s " WHITE_BOLD("use %s ") CYAN_BOLD("%s:%d ") GREEN_BOLD("%s") " " BLACK_BOLD("%s"),
Tags::network(), client->mode(), pool.host().data(), pool.port(), tlsVersion ? tlsVersion : "", client->ip().data());
LOG_INFO("%s " WHITE_BOLD("use %s ") CYAN_BOLD("%s:%d%s ") GREEN_BOLD("%s") " " BLACK_BOLD("%s"),
Tags::network(), client->mode(), pool.host().data(), pool.port(), zmq_buf, tlsVersion ? tlsVersion : "", client->ip().data());
const char *fingerprint = client->tlsFingerprint();
if (fingerprint != nullptr) {
@ -279,11 +284,22 @@ void xmrig::Network::setJob(IClient *client, const Job &job, bool donate)
if (!BenchState::size())
# endif
{
uint64_t diff = job.diff();;
uint64_t diff = job.diff();
const char *scale = NetworkState::scaleDiff(diff);
LOG_INFO("%s " MAGENTA_BOLD("new job") " from " WHITE_BOLD("%s:%d") " diff " WHITE_BOLD("%" PRIu64 "%s") " algo " WHITE_BOLD("%s") " height " WHITE_BOLD("%" PRIu64),
Tags::network(), client->pool().host().data(), client->pool().port(), diff, scale, job.algorithm().shortName(), job.height());
char zmq_buf[32] = {};
if (client->pool().zmq_port() >= 0) {
snprintf(zmq_buf, sizeof(zmq_buf), " (ZMQ:%d)", client->pool().zmq_port());
}
char tx_buf[32] = {};
const uint32_t num_transactions = job.getNumTransactions();
if (num_transactions > 0) {
snprintf(tx_buf, sizeof(tx_buf), " (%u tx)", num_transactions);
}
LOG_INFO("%s " MAGENTA_BOLD("new job") " from " WHITE_BOLD("%s:%d%s") " diff " WHITE_BOLD("%" PRIu64 "%s") " algo " WHITE_BOLD("%s") " height " WHITE_BOLD("%" PRIu64) "%s",
Tags::network(), client->pool().host().data(), client->pool().port(), zmq_buf, diff, scale, job.algorithm().shortName(), job.height(), tx_buf);
}
if (!donate && m_donate) {

View file

@ -69,9 +69,9 @@ xmrig::DonateStrategy::DonateStrategy(Controller *controller, IStrategyListener
static char donate_user[] = "89TxfrUmqJJcb1V124WsUzA78Xa3UYHt7Bg8RGMhXVeZYPN8cE5CZEk58Y1m23ZMLHN7wYeJ9da5n5MXharEjrm41hSnWHL";
# ifdef XMRIG_FEATURE_TLS
m_pools.emplace_back(kDonateHost, 20001, donate_user, nullptr, 0, true, true, mode);
m_pools.emplace_back(kDonateHost, 20001, donate_user, nullptr, nullptr, 0, true, true, mode);
# endif
m_pools.emplace_back(kDonateHost, 10001, donate_user, nullptr, 0, true, false, mode);
m_pools.emplace_back(kDonateHost, 10001, donate_user, nullptr, nullptr, 0, true, false, mode);
if (m_pools.size() > 1) {
m_strategy = new FailoverStrategy(m_pools, 10, 2, this, true);
@ -251,7 +251,7 @@ xmrig::IClient *xmrig::DonateStrategy::createProxy()
const IClient *client = strategy->client();
m_tls = client->hasExtension(IClient::EXT_TLS);
Pool pool(client->pool().proxy().isValid() ? client->pool().host() : client->ip(), client->pool().port(), m_userId, client->pool().password(), 0, true, client->isTLS(), Pool::MODE_POOL);
Pool pool(client->pool().proxy().isValid() ? client->pool().host() : client->ip(), client->pool().port(), m_userId, client->pool().password(), client->pool().spendSecretKey(), 0, true, client->isTLS(), Pool::MODE_POOL);
pool.setAlgo(client->pool().algorithm());
pool.setProxy(client->pool().proxy());