mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-10 09:02:45 -05:00
Compare commits
10 Commits
v6.20.0
...
e855723cd9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e855723cd9 | ||
|
|
6e294bd046 | ||
|
|
dfe70d9ea7 | ||
|
|
2ecf10cdcb | ||
|
|
b55ca8e547 | ||
|
|
12577df7ba | ||
|
|
64f5bb467a | ||
|
|
5717e72367 | ||
|
|
e7de104d88 | ||
|
|
3b5e04b1b7 |
@@ -1,6 +1,6 @@
|
|||||||
/* XMRig
|
/* XMRig
|
||||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -49,6 +49,12 @@ public:
|
|||||||
static inline bool isUserActive(uint64_t ms) { return idleTime() < ms; }
|
static inline bool isUserActive(uint64_t ms) { return idleTime() < ms; }
|
||||||
static inline const String &userAgent() { return m_userAgent; }
|
static inline const String &userAgent() { return m_userAgent; }
|
||||||
|
|
||||||
|
# ifdef XMRIG_OS_WIN
|
||||||
|
static bool hasKeepalive();
|
||||||
|
# else
|
||||||
|
static constexpr bool hasKeepalive() { return true; }
|
||||||
|
# endif
|
||||||
|
|
||||||
static bool isOnBatteryPower();
|
static bool isOnBatteryPower();
|
||||||
static uint64_t idleTime();
|
static uint64_t idleTime();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* XMRig
|
/* XMRig
|
||||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@@ -70,6 +69,12 @@ char *xmrig::Platform::createUserAgent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool xmrig::Platform::hasKeepalive()
|
||||||
|
{
|
||||||
|
return winOsVersion().dwMajorVersion >= 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef XMRIG_FEATURE_HWLOC
|
#ifndef XMRIG_FEATURE_HWLOC
|
||||||
bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ void xmrig::BaseConfig::printVersions()
|
|||||||
snprintf(buf, sizeof buf, "MSVC/%d", MSVC_VERSION);
|
snprintf(buf, sizeof buf, "MSVC/%d", MSVC_VERSION);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("%s/%s") WHITE_BOLD(" %s"), "ABOUT", APP_NAME, APP_VERSION, buf);
|
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("%s/%s") WHITE_BOLD(" %s") WHITE_BOLD(" (built for %s") WHITE_BOLD(" %s,") WHITE_BOLD(" %s)"), "ABOUT", APP_NAME, APP_VERSION, buf, APP_OS, APP_ARCH, APP_BITS);
|
||||||
|
|
||||||
std::string libs;
|
std::string libs;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* XMRig
|
/* XMRig
|
||||||
* Copyright (c) 2019 jtgrassie <https://github.com/jtgrassie>
|
* Copyright (c) 2019 jtgrassie <https://github.com/jtgrassie>
|
||||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -42,13 +42,14 @@
|
|||||||
#include "base/io/json/JsonRequest.h"
|
#include "base/io/json/JsonRequest.h"
|
||||||
#include "base/io/log/Log.h"
|
#include "base/io/log/Log.h"
|
||||||
#include "base/kernel/interfaces/IClientListener.h"
|
#include "base/kernel/interfaces/IClientListener.h"
|
||||||
|
#include "base/kernel/Platform.h"
|
||||||
#include "base/net/dns/Dns.h"
|
#include "base/net/dns/Dns.h"
|
||||||
#include "base/net/dns/DnsRecords.h"
|
#include "base/net/dns/DnsRecords.h"
|
||||||
#include "base/net/stratum/Socks5.h"
|
#include "base/net/stratum/Socks5.h"
|
||||||
#include "base/net/tools/NetBuffer.h"
|
#include "base/net/tools/NetBuffer.h"
|
||||||
#include "base/tools/Chrono.h"
|
#include "base/tools/Chrono.h"
|
||||||
#include "base/tools/Cvt.h"
|
|
||||||
#include "base/tools/cryptonote/BlobReader.h"
|
#include "base/tools/cryptonote/BlobReader.h"
|
||||||
|
#include "base/tools/Cvt.h"
|
||||||
#include "net/JobResult.h"
|
#include "net/JobResult.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -343,6 +344,9 @@ bool xmrig::Client::close()
|
|||||||
setState(ClosingState);
|
setState(ClosingState);
|
||||||
|
|
||||||
if (uv_is_closing(reinterpret_cast<uv_handle_t*>(m_socket)) == 0) {
|
if (uv_is_closing(reinterpret_cast<uv_handle_t*>(m_socket)) == 0) {
|
||||||
|
if (Platform::hasKeepalive()) {
|
||||||
|
uv_tcp_keepalive(m_socket, 0, 60);
|
||||||
|
}
|
||||||
uv_close(reinterpret_cast<uv_handle_t*>(m_socket), Client::onClose);
|
uv_close(reinterpret_cast<uv_handle_t*>(m_socket), Client::onClose);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,9 +571,9 @@ void xmrig::Client::connect(const sockaddr *addr)
|
|||||||
uv_tcp_init(uv_default_loop(), m_socket);
|
uv_tcp_init(uv_default_loop(), m_socket);
|
||||||
uv_tcp_nodelay(m_socket, 1);
|
uv_tcp_nodelay(m_socket, 1);
|
||||||
|
|
||||||
# ifndef WIN32
|
if (Platform::hasKeepalive()) {
|
||||||
uv_tcp_keepalive(m_socket, 1, 60);
|
uv_tcp_keepalive(m_socket, 1, 60);
|
||||||
# endif
|
}
|
||||||
|
|
||||||
uv_tcp_connect(req, m_socket, addr, onConnect);
|
uv_tcp_connect(req, m_socket, addr, onConnect);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
/* XMRig
|
/* XMRig
|
||||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
* Copyright (c) 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
* Copyright (c) 2012-2014 pooler <pooler@litecoinpool.org>
|
||||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
* Copyright (c) 2014 Lucas Jones <https://github.com/lucasjones>
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright (c) 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright (c) 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright (c) 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2019 Howard Chu <https://github.com/hyc>
|
* Copyright (c) 2019 Howard Chu <https://github.com/hyc>
|
||||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -34,6 +33,7 @@
|
|||||||
#include "base/io/json/JsonRequest.h"
|
#include "base/io/json/JsonRequest.h"
|
||||||
#include "base/io/log/Log.h"
|
#include "base/io/log/Log.h"
|
||||||
#include "base/kernel/interfaces/IClientListener.h"
|
#include "base/kernel/interfaces/IClientListener.h"
|
||||||
|
#include "base/kernel/Platform.h"
|
||||||
#include "base/net/dns/Dns.h"
|
#include "base/net/dns/Dns.h"
|
||||||
#include "base/net/dns/DnsRecords.h"
|
#include "base/net/dns/DnsRecords.h"
|
||||||
#include "base/net/http/Fetch.h"
|
#include "base/net/http/Fetch.h"
|
||||||
@@ -42,9 +42,9 @@
|
|||||||
#include "base/net/stratum/SubmitResult.h"
|
#include "base/net/stratum/SubmitResult.h"
|
||||||
#include "base/net/tools/NetBuffer.h"
|
#include "base/net/tools/NetBuffer.h"
|
||||||
#include "base/tools/bswap_64.h"
|
#include "base/tools/bswap_64.h"
|
||||||
|
#include "base/tools/cryptonote/Signatures.h"
|
||||||
#include "base/tools/Cvt.h"
|
#include "base/tools/Cvt.h"
|
||||||
#include "base/tools/Timer.h"
|
#include "base/tools/Timer.h"
|
||||||
#include "base/tools/cryptonote/Signatures.h"
|
|
||||||
#include "net/JobResult.h"
|
#include "net/JobResult.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -358,9 +358,9 @@ void xmrig::DaemonClient::onResolved(const DnsRecords &records, int status, cons
|
|||||||
uv_tcp_init(uv_default_loop(), s);
|
uv_tcp_init(uv_default_loop(), s);
|
||||||
uv_tcp_nodelay(s, 1);
|
uv_tcp_nodelay(s, 1);
|
||||||
|
|
||||||
# ifndef WIN32
|
if (Platform::hasKeepalive()) {
|
||||||
uv_tcp_keepalive(s, 1, 60);
|
uv_tcp_keepalive(s, 1, 60);
|
||||||
# endif
|
}
|
||||||
|
|
||||||
if (m_pool.zmq_port() > 0) {
|
if (m_pool.zmq_port() > 0) {
|
||||||
delete m_ZMQSocket;
|
delete m_ZMQSocket;
|
||||||
@@ -589,6 +589,9 @@ void xmrig::DaemonClient::retry()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((m_ZMQConnectionState != ZMQ_NOT_CONNECTED) && (m_ZMQConnectionState != ZMQ_DISCONNECTING)) {
|
if ((m_ZMQConnectionState != ZMQ_NOT_CONNECTED) && (m_ZMQConnectionState != ZMQ_DISCONNECTING)) {
|
||||||
|
if (Platform::hasKeepalive()) {
|
||||||
|
uv_tcp_keepalive(m_ZMQSocket, 0, 60);
|
||||||
|
}
|
||||||
uv_close(reinterpret_cast<uv_handle_t*>(m_ZMQSocket), onZMQClose);
|
uv_close(reinterpret_cast<uv_handle_t*>(m_ZMQSocket), onZMQClose);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -916,6 +919,9 @@ bool xmrig::DaemonClient::ZMQClose(bool shutdown)
|
|||||||
m_ZMQConnectionState = ZMQ_DISCONNECTING;
|
m_ZMQConnectionState = ZMQ_DISCONNECTING;
|
||||||
|
|
||||||
if (uv_is_closing(reinterpret_cast<uv_handle_t*>(m_ZMQSocket)) == 0) {
|
if (uv_is_closing(reinterpret_cast<uv_handle_t*>(m_ZMQSocket)) == 0) {
|
||||||
|
if (Platform::hasKeepalive()) {
|
||||||
|
uv_tcp_keepalive(m_ZMQSocket, 0, 60);
|
||||||
|
}
|
||||||
uv_close(reinterpret_cast<uv_handle_t*>(m_ZMQSocket), shutdown ? onZMQShutdown : onZMQClose);
|
uv_close(reinterpret_cast<uv_handle_t*>(m_ZMQSocket), shutdown ? onZMQShutdown : onZMQClose);
|
||||||
if (!shutdown) {
|
if (!shutdown) {
|
||||||
retry();
|
retry();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* XMRig
|
/* XMRig
|
||||||
* Copyright (c) 2018-2020 tevador <tevador@gmail.com>
|
* Copyright (c) 2018-2020 tevador <tevador@gmail.com>
|
||||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
* Copyright (c) 2018-2023 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright (c) 2016-2023 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "crypto/common/VirtualMemory.h"
|
#include "crypto/common/VirtualMemory.h"
|
||||||
#include "backend/cpu/Cpu.h"
|
#include "backend/cpu/Cpu.h"
|
||||||
#include "crypto/common/portable/mm_malloc.h"
|
#include "crypto/common/portable/mm_malloc.h"
|
||||||
@@ -25,6 +24,7 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <fstream>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -84,7 +84,9 @@ static inline int hugePagesFlag(size_t size)
|
|||||||
|
|
||||||
bool xmrig::VirtualMemory::isHugepagesAvailable()
|
bool xmrig::VirtualMemory::isHugepagesAvailable()
|
||||||
{
|
{
|
||||||
# if defined(XMRIG_OS_MACOS) && defined(XMRIG_ARM)
|
# ifdef XMRIG_OS_LINUX
|
||||||
|
return std::ifstream("/proc/sys/vm/nr_hugepages").good() || std::ifstream("/sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages").good();
|
||||||
|
# elif defined(XMRIG_OS_MACOS) && defined(XMRIG_ARM)
|
||||||
return false;
|
return false;
|
||||||
# else
|
# else
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#define APP_ID "xmrig"
|
#define APP_ID "xmrig"
|
||||||
#define APP_NAME "XMRig"
|
#define APP_NAME "XMRig"
|
||||||
#define APP_DESC "XMRig miner"
|
#define APP_DESC "XMRig miner"
|
||||||
#define APP_VERSION "6.20.0"
|
#define APP_VERSION "6.20.1-dev"
|
||||||
#define APP_DOMAIN "xmrig.com"
|
#define APP_DOMAIN "xmrig.com"
|
||||||
#define APP_SITE "www.xmrig.com"
|
#define APP_SITE "www.xmrig.com"
|
||||||
#define APP_COPYRIGHT "Copyright (C) 2016-2023 xmrig.com"
|
#define APP_COPYRIGHT "Copyright (C) 2016-2023 xmrig.com"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#define APP_VER_MAJOR 6
|
#define APP_VER_MAJOR 6
|
||||||
#define APP_VER_MINOR 20
|
#define APP_VER_MINOR 20
|
||||||
#define APP_VER_PATCH 0
|
#define APP_VER_PATCH 1
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# if (_MSC_VER >= 1930)
|
# if (_MSC_VER >= 1930)
|
||||||
@@ -52,4 +52,39 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef XMRIG_OS_WIN
|
||||||
|
# define APP_OS "Windows"
|
||||||
|
#elif defined XMRIG_OS_IOS
|
||||||
|
# define APP_OS "iOS"
|
||||||
|
#elif defined XMRIG_OS_MACOS
|
||||||
|
# define APP_OS "macOS"
|
||||||
|
#elif defined XMRIG_OS_ANDROID
|
||||||
|
# define APP_OS "Android"
|
||||||
|
#elif defined XMRIG_OS_LINUX
|
||||||
|
# define APP_OS "Linux"
|
||||||
|
#elif defined XMRIG_OS_FREEBSD
|
||||||
|
# define APP_OS "FreeBSD"
|
||||||
|
#else
|
||||||
|
# define APP_OS "Unknown OS"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define STR(X) #X
|
||||||
|
#define STR2(X) STR(X)
|
||||||
|
|
||||||
|
#ifdef XMRIG_ARM
|
||||||
|
# define APP_ARCH "ARMv" STR2(XMRIG_ARM)
|
||||||
|
#else
|
||||||
|
# if defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
|
||||||
|
# define APP_ARCH "x86-64"
|
||||||
|
# else
|
||||||
|
# define APP_ARCH "x86"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XMRIG_64_BIT
|
||||||
|
# define APP_BITS "64 bit"
|
||||||
|
#else
|
||||||
|
# define APP_BITS "32 bit"
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // XMRIG_VERSION_H
|
#endif // XMRIG_VERSION_H
|
||||||
|
|||||||
Reference in New Issue
Block a user