Implemented dynamic pool reload.
This commit is contained in:
parent
7c789a0d3c
commit
9c088eabc2
5 changed files with 59 additions and 24 deletions
|
@ -51,6 +51,16 @@ xmrig::Pool &xmrig::Pools::current()
|
|||
}
|
||||
|
||||
|
||||
bool xmrig::Pools::isEqual(const Pools &other) const
|
||||
{
|
||||
if (m_data.size() != other.m_data.size() || m_retries != other.m_retries || m_retryPause != other.m_retryPause) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return std::equal(m_data.begin(), m_data.end(), other.m_data.begin());
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::Pools::setUrl(const char *url)
|
||||
{
|
||||
if (m_data.empty() || m_data.back().isValid()) {
|
||||
|
@ -144,7 +154,7 @@ void xmrig::Pools::load(const rapidjson::Value &pools)
|
|||
}
|
||||
|
||||
|
||||
void xmrig::Pools::print()
|
||||
void xmrig::Pools::print() const
|
||||
{
|
||||
size_t i = 1;
|
||||
for (const Pool &pool : m_data) {
|
||||
|
|
|
@ -59,13 +59,17 @@ public:
|
|||
inline void setVariant(const char *variant) { current().algorithm().parseVariant(variant); }
|
||||
inline void setVariant(int variant) { current().algorithm().parseVariant(variant); }
|
||||
|
||||
inline bool operator!=(const Pools &other) const { return !isEqual(other); }
|
||||
inline bool operator==(const Pools &other) const { return isEqual(other); }
|
||||
|
||||
bool isEqual(const Pools &other) const;
|
||||
bool setUrl(const char *url);
|
||||
IStrategy *createStrategy(IStrategyListener *listener) const;
|
||||
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
||||
size_t active() const;
|
||||
void adjust(const Algorithm &algorithm);
|
||||
void load(const rapidjson::Value &pools);
|
||||
void print();
|
||||
void print() const;
|
||||
void setRetries(int retries);
|
||||
void setRetryPause(int retryPause);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue