mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-11 01:22:45 -05:00
Return current algorithm in API response.
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
|
||||
|
||||
xmrig::Network::Network(Controller *controller) :
|
||||
m_controller(controller),
|
||||
m_donate(nullptr),
|
||||
m_timer(nullptr)
|
||||
{
|
||||
@@ -230,6 +231,9 @@ void xmrig::Network::getConnection(rapidjson::Value &reply, rapidjson::Document
|
||||
using namespace rapidjson;
|
||||
auto &allocator = doc.GetAllocator();
|
||||
|
||||
const Algorithm &algo = m_strategy->client()->job().algorithm();
|
||||
reply.AddMember("algo", StringRef((algo.isValid() ? algo : m_controller->config()->algorithm()).shortName()), allocator);
|
||||
|
||||
Value connection(kObjectType);
|
||||
connection.AddMember("pool", StringRef(m_state.pool), allocator);
|
||||
connection.AddMember("uptime", m_state.connectionTime(), allocator);
|
||||
|
||||
@@ -78,6 +78,7 @@ private:
|
||||
void getResults(rapidjson::Value &reply, rapidjson::Document &doc) const;
|
||||
# endif
|
||||
|
||||
Controller *m_controller;
|
||||
IStrategy *m_donate;
|
||||
IStrategy *m_strategy;
|
||||
NetworkState m_state;
|
||||
|
||||
@@ -92,7 +92,7 @@ void xmrig::NetworkState::add(const SubmitResult &result, const char *error)
|
||||
std::sort(topDiff.rbegin(), topDiff.rend());
|
||||
}
|
||||
|
||||
m_latency.push_back(result.elapsed > 0xFFFF ? 0xFFFF : (uint16_t) result.elapsed);
|
||||
m_latency.push_back(result.elapsed > 0xFFFF ? 0xFFFF : static_cast<uint16_t>(result.elapsed));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user