mirror of
https://github.com/xmrig/xmrig.git
synced 2026-06-30 22:32:39 -04:00
Compare commits
4 Commits
3be1e745e8
...
24af2bf317
| Author | SHA1 | Date | |
|---|---|---|---|
| 24af2bf317 | |||
| 71209d4cd7 | |||
| 0a3313cb76 | |||
| 8f507b7d09 |
@@ -20,7 +20,7 @@ set(SOURCES_BACKEND_COMMON
|
|||||||
src/backend/common/Workers.cpp
|
src/backend/common/Workers.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if (WITH_RANDOMX AND WITH_BENCHMARK)
|
if (WITH_BENCHMARK AND (WITH_RANDOMX OR WITH_GHOSTRIDER))
|
||||||
list(APPEND HEADERS_BACKEND_COMMON
|
list(APPEND HEADERS_BACKEND_COMMON
|
||||||
src/backend/common/benchmark/Benchmark.h
|
src/backend/common/benchmark/Benchmark.h
|
||||||
src/backend/common/benchmark/BenchState_test.h
|
src/backend/common/benchmark/BenchState_test.h
|
||||||
|
|||||||
+1
-1
@@ -259,7 +259,7 @@ if (WITH_KAWPOW OR WITH_GHOSTRIDER)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if (WITH_RANDOMX AND WITH_BENCHMARK)
|
if (WITH_BENCHMARK AND (WITH_RANDOMX OR WITH_GHOSTRIDER))
|
||||||
add_definitions(/DXMRIG_FEATURE_BENCHMARK)
|
add_definitions(/DXMRIG_FEATURE_BENCHMARK)
|
||||||
|
|
||||||
list(APPEND HEADERS_BASE
|
list(APPEND HEADERS_BASE
|
||||||
|
|||||||
@@ -589,7 +589,7 @@ void xmrig::Client::handshake()
|
|||||||
if (isTLS()) {
|
if (isTLS()) {
|
||||||
m_expire = Chrono::steadyMSecs() + kResponseTimeout;
|
m_expire = Chrono::steadyMSecs() + kResponseTimeout;
|
||||||
|
|
||||||
m_tls->handshake();
|
m_tls->handshake(m_pool.isSNI() ? m_pool.host().data() : nullptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ const char *Pool::kSelfSelect = "self-select";
|
|||||||
const char *Pool::kSOCKS5 = "socks5";
|
const char *Pool::kSOCKS5 = "socks5";
|
||||||
const char *Pool::kSubmitToOrigin = "submit-to-origin";
|
const char *Pool::kSubmitToOrigin = "submit-to-origin";
|
||||||
const char *Pool::kTls = "tls";
|
const char *Pool::kTls = "tls";
|
||||||
|
const char *Pool::kSni = "sni";
|
||||||
const char *Pool::kUrl = "url";
|
const char *Pool::kUrl = "url";
|
||||||
const char *Pool::kUser = "user";
|
const char *Pool::kUser = "user";
|
||||||
const char *Pool::kSpendSecretKey = "spend-secret-key";
|
const char *Pool::kSpendSecretKey = "spend-secret-key";
|
||||||
@@ -137,6 +138,7 @@ xmrig::Pool::Pool(const rapidjson::Value &object) :
|
|||||||
m_flags.set(FLAG_ENABLED, Json::getBool(object, kEnabled, true));
|
m_flags.set(FLAG_ENABLED, Json::getBool(object, kEnabled, true));
|
||||||
m_flags.set(FLAG_NICEHASH, Json::getBool(object, kNicehash) || m_url.host().contains(kNicehashHost));
|
m_flags.set(FLAG_NICEHASH, Json::getBool(object, kNicehash) || m_url.host().contains(kNicehashHost));
|
||||||
m_flags.set(FLAG_TLS, Json::getBool(object, kTls) || m_url.isTLS());
|
m_flags.set(FLAG_TLS, Json::getBool(object, kTls) || m_url.isTLS());
|
||||||
|
m_flags.set(FLAG_SNI, Json::getBool(object, kSni));
|
||||||
|
|
||||||
setKeepAlive(Json::getValue(object, kKeepalive));
|
setKeepAlive(Json::getValue(object, kKeepalive));
|
||||||
|
|
||||||
@@ -299,6 +301,7 @@ rapidjson::Value xmrig::Pool::toJSON(rapidjson::Document &doc) const
|
|||||||
|
|
||||||
obj.AddMember(StringRef(kEnabled), m_flags.test(FLAG_ENABLED), allocator);
|
obj.AddMember(StringRef(kEnabled), m_flags.test(FLAG_ENABLED), allocator);
|
||||||
obj.AddMember(StringRef(kTls), isTLS(), allocator);
|
obj.AddMember(StringRef(kTls), isTLS(), allocator);
|
||||||
|
obj.AddMember(StringRef(kSni), isSNI(), allocator);
|
||||||
obj.AddMember(StringRef(kFingerprint), m_fingerprint.toJSON(), allocator);
|
obj.AddMember(StringRef(kFingerprint), m_fingerprint.toJSON(), allocator);
|
||||||
obj.AddMember(StringRef(kDaemon), m_mode == MODE_DAEMON, allocator);
|
obj.AddMember(StringRef(kDaemon), m_mode == MODE_DAEMON, allocator);
|
||||||
obj.AddMember(StringRef(kSOCKS5), m_proxy.toJSON(doc), allocator);
|
obj.AddMember(StringRef(kSOCKS5), m_proxy.toJSON(doc), allocator);
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public:
|
|||||||
static const char *kSOCKS5;
|
static const char *kSOCKS5;
|
||||||
static const char *kSubmitToOrigin;
|
static const char *kSubmitToOrigin;
|
||||||
static const char *kTls;
|
static const char *kTls;
|
||||||
|
static const char* kSni;
|
||||||
static const char *kUrl;
|
static const char *kUrl;
|
||||||
static const char *kUser;
|
static const char *kUser;
|
||||||
static const char* kSpendSecretKey;
|
static const char* kSpendSecretKey;
|
||||||
@@ -95,6 +96,7 @@ public:
|
|||||||
|
|
||||||
inline bool isNicehash() const { return m_flags.test(FLAG_NICEHASH); }
|
inline bool isNicehash() const { return m_flags.test(FLAG_NICEHASH); }
|
||||||
inline bool isTLS() const { return m_flags.test(FLAG_TLS) || m_url.isTLS(); }
|
inline bool isTLS() const { return m_flags.test(FLAG_TLS) || m_url.isTLS(); }
|
||||||
|
inline bool isSNI() const { return m_flags.test(FLAG_SNI); }
|
||||||
inline bool isValid() const { return m_url.isValid(); }
|
inline bool isValid() const { return m_url.isValid(); }
|
||||||
inline const Algorithm &algorithm() const { return m_algorithm; }
|
inline const Algorithm &algorithm() const { return m_algorithm; }
|
||||||
inline const Coin &coin() const { return m_coin; }
|
inline const Coin &coin() const { return m_coin; }
|
||||||
@@ -138,6 +140,7 @@ private:
|
|||||||
FLAG_ENABLED,
|
FLAG_ENABLED,
|
||||||
FLAG_NICEHASH,
|
FLAG_NICEHASH,
|
||||||
FLAG_TLS,
|
FLAG_TLS,
|
||||||
|
FLAG_SNI,
|
||||||
FLAG_MAX
|
FLAG_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ xmrig::Client::Tls::~Tls()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool xmrig::Client::Tls::handshake()
|
bool xmrig::Client::Tls::handshake(const char* servername)
|
||||||
{
|
{
|
||||||
m_ssl = SSL_new(m_ctx);
|
m_ssl = SSL_new(m_ctx);
|
||||||
assert(m_ssl != nullptr);
|
assert(m_ssl != nullptr);
|
||||||
@@ -69,6 +69,10 @@ bool xmrig::Client::Tls::handshake()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (servername) {
|
||||||
|
SSL_set_tlsext_host_name(m_ssl, servername);
|
||||||
|
}
|
||||||
|
|
||||||
SSL_set_connect_state(m_ssl);
|
SSL_set_connect_state(m_ssl);
|
||||||
SSL_set_bio(m_ssl, m_read, m_write);
|
SSL_set_bio(m_ssl, m_read, m_write);
|
||||||
SSL_do_handshake(m_ssl);
|
SSL_do_handshake(m_ssl);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
Tls(Client *client);
|
Tls(Client *client);
|
||||||
~Tls();
|
~Tls();
|
||||||
|
|
||||||
bool handshake();
|
bool handshake(const char* servername);
|
||||||
bool send(const char *data, size_t size);
|
bool send(const char *data, size_t size);
|
||||||
const char *fingerprint() const;
|
const char *fingerprint() const;
|
||||||
const char *version() const;
|
const char *version() const;
|
||||||
|
|||||||
@@ -333,8 +333,8 @@ void benchmark()
|
|||||||
|
|
||||||
const CnHash::AlgoVariant* av = Cpu::info()->hasAES() ? av_hw_aes : av_soft_aes;
|
const CnHash::AlgoVariant* av = Cpu::info()->hasAES() ? av_hw_aes : av_soft_aes;
|
||||||
|
|
||||||
uint8_t buf[80];
|
uint8_t buf[80] = { 0 };
|
||||||
uint8_t hash[32 * 8];
|
uint8_t hash[32 * 8] = { 0 };
|
||||||
|
|
||||||
LOG_VERBOSE("%24s | N | Hashrate", "Algorithm");
|
LOG_VERBOSE("%24s | N | Hashrate", "Algorithm");
|
||||||
LOG_VERBOSE("-------------------------|-----|-------------");
|
LOG_VERBOSE("-------------------------|-----|-------------");
|
||||||
@@ -540,10 +540,13 @@ HelperThread* create_helper_thread(int64_t cpu_index, int priority, const std::v
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (hwloc_bitmap_weight(helper_cpu_set) > 0) {
|
if (hwloc_bitmap_weight(helper_cpu_set) > 0) {
|
||||||
|
hwloc_bitmap_free(main_threads_set);
|
||||||
return new HelperThread(helper_cpu_set, priority, is8MB);
|
return new HelperThread(helper_cpu_set, priority, is8MB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hwloc_bitmap_free(helper_cpu_set);
|
||||||
|
hwloc_bitmap_free(main_threads_set);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user