Skip to content

Commit

Permalink
Sync changes with AMD miner.
Browse files Browse the repository at this point in the history
  • Loading branch information
xmrig committed Feb 21, 2019
1 parent eec5ca5 commit cac2401
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/api/ApiRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,16 @@ void ApiRouter::getThreads(rapidjson::Document &doc) const
const std::vector<xmrig::IThread *> &threads = m_controller->config()->threads();
rapidjson::Value list(rapidjson::kArrayType);

size_t i = 0;
for (const xmrig::IThread *thread : threads) {
rapidjson::Value value = thread->toAPI(doc);

rapidjson::Value hashrate(rapidjson::kArrayType);
hashrate.PushBack(normalize(hr->calc(thread->index(), Hashrate::ShortInterval)), allocator);
hashrate.PushBack(normalize(hr->calc(thread->index(), Hashrate::MediumInterval)), allocator);
hashrate.PushBack(normalize(hr->calc(thread->index(), Hashrate::LargeInterval)), allocator);
hashrate.PushBack(normalize(hr->calc(i, Hashrate::ShortInterval)), allocator);
hashrate.PushBack(normalize(hr->calc(i, Hashrate::MediumInterval)), allocator);
hashrate.PushBack(normalize(hr->calc(i, Hashrate::LargeInterval)), allocator);

i++;

value.AddMember("hashrate", hashrate, allocator);
list.PushBack(value, allocator);
Expand Down

1 comment on commit cac2401

@crypthomax
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job.

How to have some mining programs on my phone?

Please sign in to comment.