1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
From: Bastian Germann <bage@debian.org>
Date: Mon, 17 Apr 2023 19:59:55 +0200
Subject: Build stratum without libethash
Directly use the byteswap.h functions.
---
src/base/net/stratum/EthStratumClient.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/base/net/stratum/EthStratumClient.cpp b/src/base/net/stratum/EthStratumClient.cpp
index fd877d7..afb7d64 100644
--- a/src/base/net/stratum/EthStratumClient.cpp
+++ b/src/base/net/stratum/EthStratumClient.cpp
@@ -23,7 +23,7 @@
#include "base/net/stratum/EthStratumClient.h"
-#include "3rdparty/libethash/endian.h"
+#include <byteswap.h>
#include "3rdparty/rapidjson/document.h"
#include "3rdparty/rapidjson/error/en.h"
#include "3rdparty/rapidjson/stringbuffer.h"
@@ -120,7 +120,7 @@ int64_t xmrig::EthStratumClient::submit(const JobResult& result)
else
# endif
{
- actual_diff = ethash_swap_u64(*((uint64_t*)result.result()));
+ actual_diff = bswap_64(*((uint64_t*)result.result()));
}
actual_diff = actual_diff ? (uint64_t(-1) / actual_diff) : 0;
@@ -345,7 +345,7 @@ void xmrig::EthStratumClient::parseNotification(const char *method, const rapidj
for (size_t i = 0; i < 80; i += sizeof(uint32_t)) {
uint32_t& k = *reinterpret_cast<uint32_t*>(buf.data() + i);
if ((i < 36) || (i >= 68)) {
- k = ethash_swap_u32(k);
+ k = bswap_32(k);
}
}
blob = Cvt::toHex(buf.data(), buf.size());
|