Skip to content

Commit

Permalink
rebase on xmrig 2.7.1-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Joon_ committed Jun 19, 2018
1 parent c3a49c4 commit 0324bb2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/build
/CMakeLists.txt.user
/build2
/.vscode
/.vscode
/.cache
4 changes: 2 additions & 2 deletions src/amd/OclGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ size_t XMRSetJob(GpuContext* ctx, uint8_t* input, size_t input_len, uint64_t tar
return OCL_ERR_API;
}

if ((ret = clSetKernelArg(ctx->Kernels[1 + cn_kernel_offset], 4, sizeof(cl_uint), &moneroNonce)) != CL_SUCCESS) {
LOG_ERR(kSetKernelArgErr, err_to_str(ret), 1 + cn_kernel_offset, 4);
if ((ret = clSetKernelArg(ctx->Kernels[1 + cn_kernel_offset], 5, sizeof(cl_uint), &moneroNonce)) != CL_SUCCESS) {
LOG_ERR(kSetKernelArgErr, err_to_str(ret), 1 + cn_kernel_offset, 5);
return OCL_ERR_API;
}
}
Expand Down
16 changes: 3 additions & 13 deletions src/common/net/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ bool Client::parseJob(const rapidjson::Value &params, int *code)
}
job.setJobId(params[NOTI::JOB_ID].GetUint());

job.algorithm().parseVariant(xmrig::VARIANT_V1);
job.algorithm().parseVariant(xmrig::VARIANT_1);

if (!verifyAlgorithm(job.algorithm())) {
*code = 6;
Expand Down Expand Up @@ -594,16 +594,6 @@ void Client::parseResponse(int64_t id, const rapidjson::Value &result, const rap
}

if (id == 1) {
int code = -1;
if (!parseLogin(result, &code)) {
if (!isQuiet()) {
LOG_ERR("[%s] login error code: %d", m_pool.url(), code);
}

close();
return;
}

m_failures = 0;
m_listener->onLoginSuccess(this);
return;
Expand Down Expand Up @@ -875,8 +865,8 @@ void Client::sendAuthorize()

rapidjson::Value params(rapidjson::kArrayType);

params.PushBack(rapidjson::StringRef(m_url.user()), allocator);
params.PushBack(rapidjson::StringRef(m_url.password()), allocator);
params.PushBack(rapidjson::StringRef(m_pool.user()), allocator);
params.PushBack(rapidjson::StringRef(m_pool.password()), allocator);

doc.AddMember("params", params, allocator);

Expand Down
6 changes: 3 additions & 3 deletions src/net/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ void Network::onResultAccepted(IStrategy *strategy, Client *client, const Submit
m_state.add(result, error);

if (error) {
LOG_INFO(m_options->colors() ? "\x1B[01;31mrejected\x1B[0m (%" PRId64 "/%" PRId64 ") diff \x1B[01;37m%" PRIu64 "\x1B[0m \x1B[31m\"%s\"\x1B[0m \x1B[01;30m(%" PRIu64 " ms)"
LOG_INFO(isColors()? "\x1B[01;31mrejected\x1B[0m (%" PRId64 "/%" PRId64 ") diff \x1B[01;37m%" PRIu64 "\x1B[0m \x1B[31m\"%s\"\x1B[0m \x1B[01;30m(%" PRIu64 " ms)"
: "rejected (%" PRId64 "/%" PRId64 ") diff %" PRIu64 " \"%s\" (%" PRIu64 " ms)",
m_state.accepted, m_state.rejected, result.diff, error, result.elapsed);
}
else {
LOG_INFO(m_options->colors() ? "\x1B[01;32maccepted\x1B[0m (%" PRId64 "/%" PRId64 ") diff \x1B[01;37m%" PRIu64 " \x1B[0m \x1B[01;30m(%" PRIu64 " ms)"
LOG_INFO(isColors()? "\x1B[01;32maccepted\x1B[0m (%" PRId64 "/%" PRId64 ") diff \x1B[01;37m%" PRIu64 " \x1B[0m \x1B[01;30m(%" PRIu64 " ms)"
: "accepted (%" PRId64 "/%" PRId64 ") diff " PRIu64" (%" PRIu64 " ms)",
m_state.accepted, m_state.rejected, result.diff, result.elapsed);
}
Expand All @@ -167,7 +167,7 @@ bool Network::isColors() const

void Network::setJob(Client *client, const Job &job, bool donate)
{
LOG_INFO(isColors() ? MAGENTA_BOLD("new job") " from " WHITE_BOLD("%s:%d") " diff " WHITE_BOLD("%d") " algo " WHITE_BOLD("%s")
LOG_INFO(isColors() ? MAGENTA_BOLD("new job") " from " WHITE_BOLD("%s:%d") " diff " WHITE_BOLD("%lu") " algo " WHITE_BOLD("%s")
: "new job from %s:%d diff %d algo %s",
client->host(), client->port(), job.diff(), job.algorithm().shortName());

Expand Down

0 comments on commit 0324bb2

Please sign in to comment.