Code cleanup.

This commit is contained in:
XMRig 2019-11-29 10:17:05 +07:00
parent 2b87a10cf2
commit 7d1be2d234
No known key found for this signature in database
GPG key ID: 446A53638BE94409
19 changed files with 75 additions and 66 deletions

View file

@ -51,10 +51,7 @@
xmrig::Api::Api(Base *base) :
m_base(base),
m_id(),
m_workerId(),
m_timestamp(Chrono::currentMSecsSinceEpoch()),
m_httpd(nullptr)
m_timestamp(Chrono::currentMSecsSinceEpoch())
{
base->addListener(this);
@ -180,9 +177,9 @@ void xmrig::Api::genId(const String &id)
uint8_t hash[200];
const size_t addrSize = sizeof(interfaces[i].phys_addr);
const size_t inSize = (sizeof(APP_KIND) - 1) + addrSize + sizeof(uint16_t);
const uint16_t port = static_cast<uint16_t>(m_base->config()->http().port());
const auto port = static_cast<uint16_t>(m_base->config()->http().port());
uint8_t *input = new uint8_t[inSize]();
auto*input = new uint8_t[inSize]();
memcpy(input, &port, sizeof(uint16_t));
memcpy(input + sizeof(uint16_t), interfaces[i].phys_addr, addrSize);
memcpy(input + sizeof(uint16_t) + addrSize, APP_KIND, (sizeof(APP_KIND) - 1));