Minor changes, based on https://github.com/xmrig/xmrig-nvidia/pull/305
This commit is contained in:
parent
921abd4623
commit
d224c0e7d8
2 changed files with 7 additions and 7 deletions
|
@ -179,13 +179,13 @@ void xmrig::Api::genId(const String &id)
|
|||
if (!interfaces[i].is_internal && interfaces[i].address.address4.sin_family == AF_INET) {
|
||||
uint8_t hash[200];
|
||||
const size_t addrSize = sizeof(interfaces[i].phys_addr);
|
||||
const size_t inSize = strlen(APP_KIND) + addrSize + sizeof(uint16_t);
|
||||
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());
|
||||
|
||||
uint8_t *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, strlen(APP_KIND));
|
||||
memcpy(input + sizeof(uint16_t) + addrSize, APP_KIND, (sizeof(APP_KIND) - 1));
|
||||
|
||||
keccak(input, inSize, hash);
|
||||
Buffer::toHex(hash, 8, m_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue