Return current algorithm in API response.

This commit is contained in:
XMRig 2019-05-01 22:07:13 +07:00
parent 378bc504fc
commit a000544fdc
6 changed files with 8 additions and 4 deletions

View file

@ -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);