Added support for solo mining with miner signatures (Wownero)
This commit is contained in:
parent
29f2dd4b9e
commit
a136790bee
20 changed files with 200 additions and 41 deletions
|
@ -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,10 @@ public:
|
|||
if (mix_hash) {
|
||||
memcpy(m_mixHash, mix_hash, sizeof(m_mixHash));
|
||||
}
|
||||
|
||||
if (miner_signature) {
|
||||
memcpy(m_minerSignature, miner_signature, sizeof(m_minerSignature));
|
||||
}
|
||||
}
|
||||
|
||||
inline JobResult(const Job &job) :
|
||||
|
@ -80,6 +84,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_minerSignature; }
|
||||
|
||||
const Algorithm algorithm;
|
||||
const String clientId;
|
||||
const String jobId;
|
||||
|
@ -92,6 +98,8 @@ 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 };
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -77,9 +77,9 @@ xmrig::DonateStrategy::DonateStrategy(Controller *controller, IStrategyListener
|
|||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
m_pools.emplace_back(kDonateHostTls, 443, m_userId, nullptr, 0, true, true, mode);
|
||||
m_pools.emplace_back(kDonateHostTls, 443, m_userId, nullptr, nullptr, 0, true, true, mode);
|
||||
# endif
|
||||
m_pools.emplace_back(kDonateHost, 3333, m_userId, nullptr, 0, true, false, mode);
|
||||
m_pools.emplace_back(kDonateHost, 3333, m_userId, nullptr, nullptr, 0, true, false, mode);
|
||||
|
||||
if (m_pools.size() > 1) {
|
||||
m_strategy = new FailoverStrategy(m_pools, 10, 2, this, true);
|
||||
|
@ -259,7 +259,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(), nullptr, 0, true, client->isTLS(), Pool::MODE_POOL);
|
||||
pool.setAlgo(client->pool().algorithm());
|
||||
pool.setProxy(client->pool().proxy());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue