Skip to content

Commit

Permalink
use the chain time
Browse files Browse the repository at this point in the history
  • Loading branch information
chajiubu committed Nov 21, 2019
1 parent 50d0849 commit ae28cd2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build
# Prerequisites
*.d

Expand Down
22 changes: 10 additions & 12 deletions src/backend/cpu/CpuWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,26 +165,24 @@ template <size_t N> void xmrig::CpuWorker<N>::start() {
}

uint32_t time_old = 0;

while (!Nonce::isOutdated(Nonce::CPU, m_job.sequence())) {
if ((m_count & 0x7) == 0) {
storeStats();
}

const Job &job = m_job.currentJob();
/*uint32_t time =
uint32_t time =
(uint32_t)std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::system_clock::now().time_since_epoch())
.count();*/
uint32_t time = *job.time();
std::chrono::system_clock::now().time_since_epoch())
.count();
if (time != time_old) {
#define REMOTE_TIME
#ifndef REMOTE_TIME
m_job.setTime(time);
#else
m_job.nextTime();
#endif
time_old = time;
time_old = time;
}

if (job.algorithm().l3() != m_algorithm.l3()) {
Expand All @@ -202,12 +200,12 @@ template <size_t N> void xmrig::CpuWorker<N>::start() {
}

for (size_t i = 0; i < N; ++i) {
if (*reinterpret_cast<uint64_t *>(m_hash + (i * 32) + 24) <
job.target()) {
/*uint32_t time =
(uint32_t)std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::system_clock::now().time_since_epoch())
.count();*/
if (*reinterpret_cast<uint64_t *>(m_hash + (i * 32) + 24) < job.target()) {
/*uint32_t timeB =
(uint32_t)std::chrono::duration_cast<std::chrono::seconds>(
std::chrono::system_clock::now().time_since_epoch())
.count();*/

JobResults::submit(
//JobResult(job, *m_job.nonce(i), time, m_hash + (i * 32)));
JobResult(job, *m_job.nonce(i), *m_job.time(i), m_hash + (i * 32)));
Expand Down

0 comments on commit ae28cd2

Please sign in to comment.