mirror of
https://github.com/xmrig/xmrig-proxy.git
synced 2026-02-09 02:59:17 +08:00
Replace uv_now to Chrono::steadyMSecs.
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2025 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2025 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
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "proxy/splitters/extra_nonce/ExtraNonceSplitter.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "proxy/Counters.h"
|
||||
@@ -95,8 +96,7 @@ void xmrig::ExtraNonceSplitter::printConnections()
|
||||
|
||||
void xmrig::ExtraNonceSplitter::tick(uint64_t ticks)
|
||||
{
|
||||
const uint64_t now = uv_now(uv_default_loop());
|
||||
m_upstream->tick(ticks, now);
|
||||
m_upstream->tick(ticks, Chrono::steadyMSecs());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2025 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2025 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
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "proxy/splitters/nicehash/NonceSplitter.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "proxy/Counters.h"
|
||||
@@ -34,7 +35,6 @@
|
||||
#include "proxy/splitters/nicehash/NonceMapper.h"
|
||||
#include "Summary.h"
|
||||
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ xmrig::Upstreams xmrig::NonceSplitter::upstreams() const
|
||||
|
||||
void xmrig::NonceSplitter::connect()
|
||||
{
|
||||
auto upstream = new NonceMapper(m_upstreams.size(), m_controller);
|
||||
auto *upstream = new NonceMapper(m_upstreams.size(), m_controller);
|
||||
m_upstreams.push_back(upstream);
|
||||
|
||||
upstream->start();
|
||||
@@ -113,7 +113,7 @@ void xmrig::NonceSplitter::printConnections()
|
||||
|
||||
void xmrig::NonceSplitter::tick(uint64_t ticks)
|
||||
{
|
||||
const uint64_t now = uv_now(uv_default_loop());
|
||||
const uint64_t now = Chrono::steadyMSecs();
|
||||
|
||||
for (NonceMapper *mapper : m_upstreams) {
|
||||
mapper->tick(ticks, now);
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2025 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2025 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
|
||||
@@ -22,10 +22,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
|
||||
#include "proxy/splitters/simple/SimpleSplitter.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "proxy/Counters.h"
|
||||
@@ -34,16 +33,16 @@
|
||||
#include "proxy/events/SubmitEvent.h"
|
||||
#include "proxy/Miner.h"
|
||||
#include "proxy/splitters/simple/SimpleMapper.h"
|
||||
#include "proxy/splitters/simple/SimpleSplitter.h"
|
||||
#include "Summary.h"
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
|
||||
#define LABEL(x) " \x1B[01;30m" x ":\x1B[0m "
|
||||
|
||||
|
||||
xmrig::SimpleSplitter::SimpleSplitter(xmrig::Controller *controller) : Splitter(controller),
|
||||
m_reuseTimeout(static_cast<uint64_t>(controller->config()->reuseTimeout())),
|
||||
m_sequence(0)
|
||||
m_reuseTimeout(static_cast<uint64_t>(controller->config()->reuseTimeout()))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -98,7 +97,7 @@ void xmrig::SimpleSplitter::printConnections()
|
||||
|
||||
void xmrig::SimpleSplitter::tick(uint64_t ticks)
|
||||
{
|
||||
const uint64_t now = uv_now(uv_default_loop());
|
||||
const uint64_t now = Chrono::steadyMSecs();
|
||||
|
||||
for (SimpleMapper *mapper : m_released) {
|
||||
delete mapper;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2025 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2025 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
|
||||
@@ -25,9 +25,8 @@
|
||||
#ifndef XMRIG_SIMPLESPLITTER_H
|
||||
#define XMRIG_SIMPLESPLITTER_H
|
||||
|
||||
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -76,12 +75,12 @@ private:
|
||||
std::map<uint64_t, SimpleMapper *> m_idles;
|
||||
std::map<uint64_t, SimpleMapper *> m_upstreams;
|
||||
std::vector<SimpleMapper *> m_released;
|
||||
uint64_t m_reuseTimeout;
|
||||
uint64_t m_sequence;
|
||||
uint64_t m_reuseTimeout = 0;
|
||||
uint64_t m_sequence = 0;
|
||||
};
|
||||
|
||||
|
||||
} /* namespace xmrig */
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
#endif /* XMRIG_SIMPLESPLITTER_H */
|
||||
#endif // XMRIG_SIMPLESPLITTER_H
|
||||
|
||||
Reference in New Issue
Block a user