From 9e9cddedc515ce3a69e86038d41f35205a8eff44 Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 1 Sep 2017 08:02:56 +0300 Subject: [PATCH] Added results statistics to API. --- CMakeLists.txt | 3 ++ src/api/Api.cpp | 12 +++++ src/api/Api.h | 2 + src/api/ApiState.cpp | 64 +++++++++++++++++------ src/api/ApiState.h | 5 ++ src/api/Results.cpp | 47 +++++++++++++++++ src/api/Results.h | 54 +++++++++++++++++++ src/interfaces/IClientListener.h | 9 ++-- src/interfaces/IStrategyListener.h | 9 ++-- src/net/Client.cpp | 8 +-- src/net/JobResult.h | 6 +++ src/net/Network.cpp | 22 ++++---- src/net/Network.h | 6 +-- src/net/SubmitResult.cpp | 44 ++++++++++++++++ src/net/SubmitResult.h | 13 ++--- src/net/strategies/DonateStrategy.cpp | 4 +- src/net/strategies/DonateStrategy.h | 2 +- src/net/strategies/FailoverStrategy.cpp | 4 +- src/net/strategies/FailoverStrategy.h | 2 +- src/net/strategies/SinglePoolStrategy.cpp | 4 +- src/net/strategies/SinglePoolStrategy.h | 2 +- 21 files changed, 265 insertions(+), 57 deletions(-) create mode 100644 src/api/Results.cpp create mode 100644 src/api/Results.h create mode 100644 src/net/SubmitResult.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 817cdcd68..f5df77184 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ set(HEADERS src/3rdparty/align.h src/api/Api.h src/api/ApiState.h + src/api/Results.h src/App.h src/Console.h src/Cpu.h @@ -64,6 +65,7 @@ set(HEADERS_CRYPTO set(SOURCES src/api/Api.cpp src/api/ApiState.cpp + src/api/Results.cpp src/App.cpp src/Console.cpp src/log/ConsoleLog.cpp @@ -76,6 +78,7 @@ set(SOURCES src/net/strategies/DonateStrategy.cpp src/net/strategies/FailoverStrategy.cpp src/net/strategies/SinglePoolStrategy.cpp + src/net/SubmitResult.cpp src/net/Url.cpp src/Options.cpp src/Platform.cpp diff --git a/src/api/Api.cpp b/src/api/Api.cpp index a1d6e8abc..dd120408a 100644 --- a/src/api/Api.cpp +++ b/src/api/Api.cpp @@ -79,3 +79,15 @@ void Api::tick(const Hashrate *hashrate) m_state->tick(hashrate); uv_mutex_unlock(&m_mutex); } + + +void Api::tick(const Results &results) +{ + if (!m_state) { + return; + } + + uv_mutex_lock(&m_mutex); + m_state->tick(results); + uv_mutex_unlock(&m_mutex); +} diff --git a/src/api/Api.h b/src/api/Api.h index ba36a9928..d228fb387 100644 --- a/src/api/Api.h +++ b/src/api/Api.h @@ -30,6 +30,7 @@ class ApiState; class Hashrate; +class Results; class Api @@ -40,6 +41,7 @@ public: static const char *get(const char *url, size_t *size, int *status); static void tick(const Hashrate *hashrate); + static void tick(const Results &results); private: static ApiState *m_state; diff --git a/src/api/ApiState.cpp b/src/api/ApiState.cpp index 8c745d9b3..af51f6dc4 100644 --- a/src/api/ApiState.cpp +++ b/src/api/ApiState.cpp @@ -48,13 +48,13 @@ extern "C" } -static inline double normalizeHs(double hashrate) +static inline double normalize(double d) { - if (!std::isnormal(hashrate)) { + if (!std::isnormal(d)) { return 0.0; } - return std::floor(hashrate * 10.0) / 10.0; + return std::floor(d * 10.0) / 10.0; } @@ -90,6 +90,8 @@ const char *ApiState::get(const char *url, size_t *size) const getIdentify(reply); getMiner(reply); getHashrate(reply); + getResults(reply); + getConnection(reply); return finalize(reply, size); } @@ -98,15 +100,21 @@ const char *ApiState::get(const char *url, size_t *size) const void ApiState::tick(const Hashrate *hashrate) { for (int i = 0; i < m_threads; ++i) { - m_hashrate[i * 3] = normalizeHs(hashrate->calc((size_t) i, Hashrate::ShortInterval)); - m_hashrate[i * 3 + 1] = normalizeHs(hashrate->calc((size_t) i, Hashrate::MediumInterval)); - m_hashrate[i * 3 + 2] = normalizeHs(hashrate->calc((size_t) i, Hashrate::LargeInterval)); + m_hashrate[i * 3] = hashrate->calc((size_t) i, Hashrate::ShortInterval); + m_hashrate[i * 3 + 1] = hashrate->calc((size_t) i, Hashrate::MediumInterval); + m_hashrate[i * 3 + 2] = hashrate->calc((size_t) i, Hashrate::LargeInterval); } - m_totalHashrate[0] = normalizeHs(hashrate->calc(Hashrate::ShortInterval)); - m_totalHashrate[1] = normalizeHs(hashrate->calc(Hashrate::MediumInterval)); - m_totalHashrate[2] = normalizeHs(hashrate->calc(Hashrate::LargeInterval)); - m_highestHashrate = normalizeHs(hashrate->highest()); + m_totalHashrate[0] = hashrate->calc(Hashrate::ShortInterval); + m_totalHashrate[1] = hashrate->calc(Hashrate::MediumInterval); + m_totalHashrate[2] = hashrate->calc(Hashrate::LargeInterval); + m_highestHashrate = hashrate->highest(); +} + + +void ApiState::tick(const Results &results) +{ + m_results = results; } @@ -144,6 +152,14 @@ void ApiState::genId() } +void ApiState::getConnection(json_t *reply) const +{ + json_t *connection = json_object(); + + json_object_set(reply, "connection", connection); +} + + void ApiState::getHashrate(json_t *reply) const { json_t *hashrate = json_object(); @@ -152,20 +168,20 @@ void ApiState::getHashrate(json_t *reply) const json_object_set(reply, "hashrate", hashrate); json_object_set(hashrate, "total", total); - json_object_set(hashrate, "highest", json_real(m_highestHashrate)); + json_object_set(hashrate, "highest", json_real(normalize(m_highestHashrate))); json_object_set(hashrate, "threads", threads); for (int i = 0; i < m_threads * 3; i += 3) { json_t *thread = json_array(); - json_array_append(thread, json_real(m_hashrate[i])); - json_array_append(thread, json_real(m_hashrate[i + 1])); - json_array_append(thread, json_real(m_hashrate[i + 2])); + json_array_append(thread, json_real(normalize(m_hashrate[i]))); + json_array_append(thread, json_real(normalize(m_hashrate[i + 1]))); + json_array_append(thread, json_real(normalize(m_hashrate[i + 2]))); json_array_append(threads, thread); } for (int i = 0; i < 3; ++i) { - json_array_append(total, json_real(m_totalHashrate[i])); + json_array_append(total, json_real(normalize(m_totalHashrate[i]))); } } @@ -193,3 +209,21 @@ void ApiState::getMiner(json_t *reply) const json_object_set(cpu, "x64", json_boolean(Cpu::isX64())); json_object_set(cpu, "sockets", json_integer(Cpu::sockets())); } + + +void ApiState::getResults(json_t *reply) const +{ + json_t *results = json_object(); + json_t *best = json_array(); + + json_object_set(reply, "results", results); + json_object_set(results, "diff_current", json_integer(m_results.diff)); + json_object_set(results, "shares_good", json_integer(m_results.accepted)); + json_object_set(results, "shares_total", json_integer(m_results.accepted + m_results.rejected)); + json_object_set(results, "hashes_total", json_integer(m_results.total)); + json_object_set(results, "best", best); + + for (size_t i = 0; i < m_results.topDiff.size(); ++i) { + json_array_append(best, json_integer(m_results.topDiff[i])); + } +} diff --git a/src/api/ApiState.h b/src/api/ApiState.h index 3405d49de..e4c4740bd 100644 --- a/src/api/ApiState.h +++ b/src/api/ApiState.h @@ -25,6 +25,7 @@ #define __APISTATE_H__ +#include "api/Results.h" #include "jansson.h" @@ -39,13 +40,16 @@ public: const char *get(const char *url, size_t *size) const; void tick(const Hashrate *hashrate); + void tick(const Results &results); private: const char *finalize(json_t *reply, size_t *size) const; void genId(); + void getConnection(json_t *reply) const; void getHashrate(json_t *reply) const; void getIdentify(json_t *reply) const; void getMiner(json_t *reply) const; + void getResults(json_t *reply) const; char m_id[17]; char m_workerId[128]; @@ -54,6 +58,7 @@ private: double m_totalHashrate[3]; int m_threads; mutable char m_buf[4096]; + Results m_results; }; #endif /* __APISTATE_H__ */ diff --git a/src/api/Results.cpp b/src/api/Results.cpp new file mode 100644 index 000000000..80f721d4f --- /dev/null +++ b/src/api/Results.cpp @@ -0,0 +1,47 @@ +/* XMRig + * Copyright 2010 Jeff Garzik + * Copyright 2012-2014 pooler + * Copyright 2014 Lucas Jones + * Copyright 2014-2016 Wolf9466 + * Copyright 2016 Jay D Dee + * Copyright 2016-2017 XMRig + * + * + * 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 . + */ + + +#include + + +#include "api/Results.h" +#include "net/SubmitResult.h" + + +void Results::add(const SubmitResult &result, const char *error) +{ + if (error) { + rejected++; + return; + } + + accepted++; + total += result.diff; + + const size_t ln = topDiff.size() - 1; + if (result.actualDiff > topDiff[ln]) { + topDiff[ln] = result.actualDiff; + std::sort(topDiff.rbegin(), topDiff.rend()); + } +} diff --git a/src/api/Results.h b/src/api/Results.h new file mode 100644 index 000000000..3f3296ef6 --- /dev/null +++ b/src/api/Results.h @@ -0,0 +1,54 @@ +/* XMRig + * Copyright 2010 Jeff Garzik + * Copyright 2012-2014 pooler + * Copyright 2014 Lucas Jones + * Copyright 2014-2016 Wolf9466 + * Copyright 2016 Jay D Dee + * Copyright 2016-2017 XMRig + * + * + * 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 . + */ + +#ifndef __RESULTS_H__ +#define __RESULTS_H__ + + +#include +#include + + +class SubmitResult; + + +class Results +{ +public: + inline Results() : + diff(0), + accepted(0), + rejected(0), + total(0) + {} + + void add(const SubmitResult &result, const char *error); + + std::array topDiff { { } }; + uint32_t diff; + uint64_t accepted; + uint64_t rejected; + uint64_t total; +}; + +#endif /* __RESULTS_H__ */ diff --git a/src/interfaces/IClientListener.h b/src/interfaces/IClientListener.h index b7c866de8..f6e7fd3c5 100644 --- a/src/interfaces/IClientListener.h +++ b/src/interfaces/IClientListener.h @@ -30,6 +30,7 @@ class Client; class Job; +class SubmitResult; class IClientListener @@ -37,10 +38,10 @@ class IClientListener public: virtual ~IClientListener() {} - virtual void onClose(Client *client, int failures) = 0; - virtual void onJobReceived(Client *client, const Job &job) = 0; - virtual void onLoginSuccess(Client *client) = 0; - virtual void onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) = 0; + virtual void onClose(Client *client, int failures) = 0; + virtual void onJobReceived(Client *client, const Job &job) = 0; + virtual void onLoginSuccess(Client *client) = 0; + virtual void onResultAccepted(Client *client, const SubmitResult &result, const char *error) = 0; }; diff --git a/src/interfaces/IStrategyListener.h b/src/interfaces/IStrategyListener.h index e71b25299..60f957349 100644 --- a/src/interfaces/IStrategyListener.h +++ b/src/interfaces/IStrategyListener.h @@ -31,6 +31,7 @@ class Client; class IStrategy; class Job; +class SubmitResult; class IStrategyListener @@ -38,10 +39,10 @@ class IStrategyListener public: virtual ~IStrategyListener() {} - virtual void onActive(Client *client) = 0; - virtual void onJob(Client *client, const Job &job) = 0; - virtual void onPause(IStrategy *strategy) = 0; - virtual void onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) = 0; + virtual void onActive(Client *client) = 0; + virtual void onJob(Client *client, const Job &job) = 0; + virtual void onPause(IStrategy *strategy) = 0; + virtual void onResultAccepted(Client *client, const SubmitResult &result, const char *error) = 0; }; diff --git a/src/net/Client.cpp b/src/net/Client.cpp index c2518be93..41bfda478 100644 --- a/src/net/Client.cpp +++ b/src/net/Client.cpp @@ -194,7 +194,7 @@ int64_t Client::submit(const JobResult &result) snprintf(req, 345, "{\"id\":%" PRIu64 ",\"jsonrpc\":\"2.0\",\"method\":\"submit\",\"params\":{\"id\":\"%s\",\"job_id\":\"%s\",\"nonce\":\"%s\",\"result\":\"%s\"}}\n", m_sequence, m_rpcId, result.jobId, nonce, data); - m_results[m_sequence] = SubmitResult(m_sequence, result.diff); + m_results[m_sequence] = SubmitResult(m_sequence, result.diff, result.actualDiff()); return send(req); } @@ -420,7 +420,8 @@ void Client::parseResponse(int64_t id, const json_t *result, const json_t *error auto it = m_results.find(id); if (it != m_results.end()) { - m_listener->onResultAccepted(this, it->second.seq, it->second.diff, it->second.elapsed(), message); + it->second.done(); + m_listener->onResultAccepted(this, it->second, message); m_results.erase(it); } else if (!m_quiet) { @@ -456,7 +457,8 @@ void Client::parseResponse(int64_t id, const json_t *result, const json_t *error auto it = m_results.find(id); if (it != m_results.end()) { - m_listener->onResultAccepted(this, it->second.seq, it->second.diff, it->second.elapsed(), nullptr); + it->second.done(); + m_listener->onResultAccepted(this, it->second, nullptr); m_results.erase(it); } } diff --git a/src/net/JobResult.h b/src/net/JobResult.h index de3b17ad3..3f69992ab 100644 --- a/src/net/JobResult.h +++ b/src/net/JobResult.h @@ -61,6 +61,12 @@ public: } + inline uint64_t actualDiff() const + { + return Job::toDiff(reinterpret_cast(result)[3]); + } + + char jobId[64]; int poolId; uint32_t diff; diff --git a/src/net/Network.cpp b/src/net/Network.cpp index d732c7748..9f83ee6da 100644 --- a/src/net/Network.cpp +++ b/src/net/Network.cpp @@ -30,12 +30,14 @@ #include +#include "api/Api.h" #include "log/Log.h" #include "net/Client.h" #include "net/Network.h" #include "net/strategies/DonateStrategy.h" #include "net/strategies/FailoverStrategy.h" #include "net/strategies/SinglePoolStrategy.h" +#include "net/SubmitResult.h" #include "net/Url.h" #include "Options.h" #include "Platform.h" @@ -44,9 +46,7 @@ Network::Network(const Options *options) : m_options(options), - m_donate(nullptr), - m_accepted(0), - m_rejected(0) + m_donate(nullptr) { srand(time(0) ^ (uintptr_t) this); @@ -139,21 +139,19 @@ void Network::onPause(IStrategy *strategy) } -void Network::onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) +void Network::onResultAccepted(Client *client, const SubmitResult &result, const char *error) { - if (error) { - m_rejected++; + m_results.add(result, error); + if (error) { LOG_INFO(m_options->colors() ? "\x1B[01;31mrejected\x1B[0m (%" PRId64 "/%" PRId64 ") diff \x1B[01;37m%u\x1B[0m \x1B[31m\"%s\"\x1B[0m \x1B[01;30m(%" PRIu64 " ms)" : "rejected (%" PRId64 "/%" PRId64 ") diff %u \"%s\" (%" PRIu64 " ms)", - m_accepted, m_rejected, diff, error, ms); + m_results.accepted, m_results.rejected, result.diff, error, result.elapsed); } else { - m_accepted++; - LOG_INFO(m_options->colors() ? "\x1B[01;32maccepted\x1B[0m (%" PRId64 "/%" PRId64 ") diff \x1B[01;37m%u\x1B[0m \x1B[01;30m(%" PRIu64 " ms)" : "accepted (%" PRId64 "/%" PRId64 ") diff %u (%" PRIu64 " ms)", - m_accepted, m_rejected, diff, ms); + m_results.accepted, m_results.rejected, result.diff, result.elapsed); } } @@ -162,12 +160,12 @@ void Network::setJob(Client *client, const Job &job) { if (m_options->colors()) { LOG_INFO("\x1B[01;35mnew job\x1B[0m from \x1B[01;37m%s:%d\x1B[0m diff \x1B[01;37m%d", client->host(), client->port(), job.diff()); - } else { LOG_INFO("new job from %s:%d diff %d", client->host(), client->port(), job.diff()); } + m_results.diff = job.diff(); Workers::setJob(job); } @@ -181,6 +179,8 @@ void Network::tick() if (m_donate) { m_donate->tick(now); } + + Api::tick(m_results); } diff --git a/src/net/Network.h b/src/net/Network.h index 33806f634..54a4f8d64 100644 --- a/src/net/Network.h +++ b/src/net/Network.h @@ -29,6 +29,7 @@ #include +#include "api/Results.h" #include "interfaces/IJobResultListener.h" #include "interfaces/IStrategyListener.h" @@ -52,7 +53,7 @@ protected: void onJob(Client *client, const Job &job) override; void onJobResult(const JobResult &result) override; void onPause(IStrategy *strategy) override; - void onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) override; + void onResultAccepted(Client *client, const SubmitResult &result, const char *error) override; private: constexpr static int kTickInterval = 1 * 1000; @@ -65,8 +66,7 @@ private: const Options *m_options; IStrategy *m_donate; IStrategy *m_strategy; - uint64_t m_accepted; - uint64_t m_rejected; + Results m_results; uv_timer_t m_timer; }; diff --git a/src/net/SubmitResult.cpp b/src/net/SubmitResult.cpp new file mode 100644 index 000000000..2e81017c0 --- /dev/null +++ b/src/net/SubmitResult.cpp @@ -0,0 +1,44 @@ +/* XMRig + * Copyright 2010 Jeff Garzik + * Copyright 2012-2014 pooler + * Copyright 2014 Lucas Jones + * Copyright 2014-2016 Wolf9466 + * Copyright 2016 Jay D Dee + * Copyright 2016-2017 XMRig + * + * + * 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 . + */ + + +#include + + +#include "net/SubmitResult.h" + + +SubmitResult::SubmitResult(int64_t seq, uint32_t diff, uint64_t actualDiff) : + seq(seq), + diff(diff), + actualDiff(actualDiff), + elapsed(0) +{ + start = uv_hrtime(); +} + + +void SubmitResult::done() +{ + elapsed = (uv_hrtime() - start) / 1000000; +} diff --git a/src/net/SubmitResult.h b/src/net/SubmitResult.h index 71a9572bf..63f5e8836 100644 --- a/src/net/SubmitResult.h +++ b/src/net/SubmitResult.h @@ -31,18 +31,15 @@ class SubmitResult { public: - inline SubmitResult() : seq(0), diff(0), start(0) {} - inline SubmitResult(int64_t seq, uint32_t diff) : - seq(seq), - diff(diff) - { - start = uv_hrtime(); - } + inline SubmitResult() : seq(0), diff(0), actualDiff(0), elapsed(0), start(0) {} + SubmitResult(int64_t seq, uint32_t diff, uint64_t actualDiff); - inline uint64_t elapsed() const { return (uv_hrtime() - start) / 1000000; } + void done(); int64_t seq; uint32_t diff; + uint64_t actualDiff; + uint64_t elapsed; uint64_t start; }; diff --git a/src/net/strategies/DonateStrategy.cpp b/src/net/strategies/DonateStrategy.cpp index 0f9814514..d7c721c66 100644 --- a/src/net/strategies/DonateStrategy.cpp +++ b/src/net/strategies/DonateStrategy.cpp @@ -111,9 +111,9 @@ void DonateStrategy::onLoginSuccess(Client *client) } -void DonateStrategy::onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) +void DonateStrategy::onResultAccepted(Client *client, const SubmitResult &result, const char *error) { - m_listener->onResultAccepted(client, seq, diff, ms, error); + m_listener->onResultAccepted(client, result, error); } diff --git a/src/net/strategies/DonateStrategy.h b/src/net/strategies/DonateStrategy.h index b54b0b176..302de292c 100644 --- a/src/net/strategies/DonateStrategy.h +++ b/src/net/strategies/DonateStrategy.h @@ -55,7 +55,7 @@ protected: void onClose(Client *client, int failures) override; void onJobReceived(Client *client, const Job &job) override; void onLoginSuccess(Client *client) override; - void onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) override; + void onResultAccepted(Client *client, const SubmitResult &result, const char *error) override; private: void idle(); diff --git a/src/net/strategies/FailoverStrategy.cpp b/src/net/strategies/FailoverStrategy.cpp index e25b8c581..47d390b06 100644 --- a/src/net/strategies/FailoverStrategy.cpp +++ b/src/net/strategies/FailoverStrategy.cpp @@ -132,9 +132,9 @@ void FailoverStrategy::onLoginSuccess(Client *client) } -void FailoverStrategy::onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) +void FailoverStrategy::onResultAccepted(Client *client, const SubmitResult &result, const char *error) { - m_listener->onResultAccepted(client, seq, diff, ms, error); + m_listener->onResultAccepted(client, result, error); } diff --git a/src/net/strategies/FailoverStrategy.h b/src/net/strategies/FailoverStrategy.h index 616a08d71..963d31575 100644 --- a/src/net/strategies/FailoverStrategy.h +++ b/src/net/strategies/FailoverStrategy.h @@ -55,7 +55,7 @@ protected: void onClose(Client *client, int failures) override; void onJobReceived(Client *client, const Job &job) override; void onLoginSuccess(Client *client) override; - void onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) override; + void onResultAccepted(Client *client, const SubmitResult &result, const char *error) override; private: void add(const Url *url, const char *agent); diff --git a/src/net/strategies/SinglePoolStrategy.cpp b/src/net/strategies/SinglePoolStrategy.cpp index f38405f46..997dc00b9 100644 --- a/src/net/strategies/SinglePoolStrategy.cpp +++ b/src/net/strategies/SinglePoolStrategy.cpp @@ -96,7 +96,7 @@ void SinglePoolStrategy::onLoginSuccess(Client *client) } -void SinglePoolStrategy::onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) +void SinglePoolStrategy::onResultAccepted(Client *client, const SubmitResult &result, const char *error) { - m_listener->onResultAccepted(client, seq, diff, ms, error); + m_listener->onResultAccepted(client, result, error); } diff --git a/src/net/strategies/SinglePoolStrategy.h b/src/net/strategies/SinglePoolStrategy.h index c09d0305b..95e21547c 100644 --- a/src/net/strategies/SinglePoolStrategy.h +++ b/src/net/strategies/SinglePoolStrategy.h @@ -52,7 +52,7 @@ protected: void onClose(Client *client, int failures) override; void onJobReceived(Client *client, const Job &job) override; void onLoginSuccess(Client *client) override; - void onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) override; + void onResultAccepted(Client *client, const SubmitResult &result, const char *error) override; private: bool m_active;