Sync changes.
This commit is contained in:
parent
9f6f599d78
commit
2a2712ab90
12 changed files with 114 additions and 33 deletions
|
@ -21,8 +21,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __JOBRESULT_H__
|
||||
#define __JOBRESULT_H__
|
||||
#ifndef XMRIG_JOBRESULT_H
|
||||
#define XMRIG_JOBRESULT_H
|
||||
|
||||
|
||||
#include <memory.h>
|
||||
|
@ -36,17 +36,29 @@ class JobResult
|
|||
{
|
||||
public:
|
||||
inline JobResult() : poolId(0), diff(0), nonce(0) {}
|
||||
inline JobResult(int poolId, const xmrig::Id &jobId, uint32_t nonce, const uint8_t *result, uint32_t diff, const xmrig::Algorithm &algorithm) :
|
||||
inline JobResult(int poolId, const xmrig::Id &jobId, const xmrig::Id &clientId, uint32_t nonce, const uint8_t *result, uint32_t diff, const xmrig::Algorithm &algorithm) :
|
||||
poolId(poolId),
|
||||
diff(diff),
|
||||
nonce(nonce),
|
||||
algorithm(algorithm),
|
||||
clientId(clientId),
|
||||
jobId(jobId)
|
||||
{
|
||||
memcpy(this->result, result, sizeof(this->result));
|
||||
}
|
||||
|
||||
|
||||
inline JobResult(const Job &job) : poolId(0), diff(0), nonce(0)
|
||||
{
|
||||
jobId = job.id();
|
||||
clientId = job.clientId();
|
||||
poolId = job.poolId();
|
||||
diff = job.diff();
|
||||
nonce = *job.nonce();
|
||||
algorithm = job.algorithm();
|
||||
}
|
||||
|
||||
|
||||
inline uint64_t actualDiff() const
|
||||
{
|
||||
return Job::toDiff(reinterpret_cast<const uint64_t*>(result)[3]);
|
||||
|
@ -58,7 +70,8 @@ public:
|
|||
uint32_t nonce;
|
||||
uint8_t result[32];
|
||||
xmrig::Algorithm algorithm;
|
||||
xmrig::Id clientId;
|
||||
xmrig::Id jobId;
|
||||
};
|
||||
|
||||
#endif /* __JOBRESULT_H__ */
|
||||
#endif /* XMRIG_JOBRESULT_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue