Added "restricted" field to "GET /1/summary" request.

This commit is contained in:
XMRig 2019-09-26 17:29:24 +07:00
parent 838f078fa5
commit 0f367ab117
2 changed files with 8 additions and 4 deletions

View file

@ -117,9 +117,10 @@ void xmrig::Api::exec(IApiRequest &request)
auto &allocator = request.doc().GetAllocator();
request.accept();
request.reply().AddMember("id", StringRef(m_id), allocator);
request.reply().AddMember("worker_id", StringRef(m_workerId), allocator);
request.reply().AddMember("uptime", (Chrono::currentMSecsSinceEpoch() - m_timestamp) / 1000, allocator);
request.reply().AddMember("id", StringRef(m_id), allocator);
request.reply().AddMember("worker_id", StringRef(m_workerId), allocator);
request.reply().AddMember("uptime", (Chrono::currentMSecsSinceEpoch() - m_timestamp) / 1000, allocator);
request.reply().AddMember("restricted", request.isRestricted(), allocator);
Value features(kArrayType);
# ifdef XMRIG_FEATURE_API

View file

@ -27,10 +27,11 @@
#include <vector>
#include <stdint.h>
#include <cstdint>
#include "base/kernel/interfaces/IBaseListener.h"
#include "base/tools/Object.h"
namespace xmrig {
@ -47,6 +48,8 @@ class String;
class Api : public IBaseListener
{
public:
XMRIG_DISABLE_COPY_MOVE_DEFAULT(Api)
Api(Base *base);
~Api() override;