1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-26 22:12:53 -05:00

Merge xmrig v6.11.0 into master

This commit is contained in:
MoneroOcean
2021-04-06 15:17:08 +00:00
41 changed files with 760 additions and 275 deletions

View File

@@ -23,6 +23,7 @@
#include "base/io/log/Log.h"
#include "base/io/log/Tags.h"
#include "base/kernel/interfaces/IJsonReader.h"
#include "base/net/dns/Dns.h"
#include "version.h"
@@ -120,6 +121,8 @@ bool xmrig::BaseConfig::read(const IJsonReader &reader, const char *fileName)
m_http.load(reader.getObject(kHttp));
m_pools.load(reader);
Dns::set(reader.getObject(DnsConfig::kField));
return m_pools.active() > 0;
}

View File

@@ -33,6 +33,7 @@
#include "base/kernel/config/BaseConfig.h"
#include "base/kernel/interfaces/IConfig.h"
#include "base/kernel/Process.h"
#include "base/net/dns/DnsConfig.h"
#include "base/net/stratum/Pool.h"
#include "base/net/stratum/Pools.h"
#include "core/config/Config_platform.h"
@@ -249,6 +250,7 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
# ifdef XMRIG_FEATURE_MO_BENCHMARK
case IConfig::BenchAlgoTimeKey: /* --bench-algo-time */
# endif
case IConfig::DnsTtlKey: /* --dns-ttl */
return transformUint64(doc, key, static_cast<uint64_t>(strtol(arg, nullptr, 10)));
case IConfig::BackgroundKey: /* --background */
@@ -269,6 +271,7 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
case IConfig::SubmitToOriginKey: /* --submit-to-origin */
case IConfig::VerboseKey: /* --verbose */
case IConfig::DnsIPv6Key: /* --dns-ipv6 */
return transformBoolean(doc, key, true);
case IConfig::ColorKey: /* --no-color */
@@ -334,6 +337,9 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b
return set(doc, BaseConfig::kRebenchAlgo, enable);
# endif
case IConfig::DnsIPv6Key: /* --dns-ipv6 */
return set(doc, DnsConfig::kField, DnsConfig::kIPv6, enable);
default:
break;
}
@@ -362,6 +368,9 @@ void xmrig::BaseTransform::transformUint64(rapidjson::Document &doc, int key, ui
case IConfig::PrintTimeKey: /* --print-time */
return set(doc, BaseConfig::kPrintTime, arg);
case IConfig::DnsTtlKey: /* --dns-ttl */
return set(doc, DnsConfig::kField, DnsConfig::kTTL, arg);
# ifdef XMRIG_FEATURE_HTTP
case IConfig::DaemonPollKey: /* --daemon-poll-interval */
return add(doc, Pools::kPools, Pool::kDaemonPollInterval, arg);

View File

@@ -82,6 +82,8 @@ public:
HugePageSizeKey = 1050,
PauseOnActiveKey = 1051,
SubmitToOriginKey = 1052,
DnsIPv6Key = 1053,
DnsTtlKey = 1054,
// xmrig common
CPUPriorityKey = 1021,

View File

@@ -0,0 +1,54 @@
/* XMRig
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_IDNSBACKEND_H
#define XMRIG_IDNSBACKEND_H
#include "base/tools/Object.h"
#include <memory>
namespace xmrig {
class DnsRecords;
class DnsRequest;
class IDnsListener;
class String;
class IDnsBackend
{
public:
XMRIG_DISABLE_COPY_MOVE(IDnsBackend)
IDnsBackend() = default;
virtual ~IDnsBackend() = default;
virtual const DnsRecords &records() const = 0;
virtual std::shared_ptr<DnsRequest> resolve(const String &host, IDnsListener *listener, uint64_t ttl) = 0;
};
} /* namespace xmrig */
#endif // XMRIG_IDNSBACKEND_H

View File

@@ -1,6 +1,6 @@
/* XMRig
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* 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
@@ -26,7 +26,7 @@
namespace xmrig {
class Dns;
class DnsRecords;
class IDnsListener
@@ -37,7 +37,7 @@ public:
IDnsListener() = default;
virtual ~IDnsListener() = default;
virtual void onResolved(const Dns &dns, int status) = 0;
virtual void onResolved(const DnsRecords &records, int status, const char *error) = 0;
};