mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-06 00:17:39 +00:00
Fixed automatic variant.
This commit is contained in:
parent
b948474d01
commit
a3873930a0
7 changed files with 21 additions and 23 deletions
|
@ -6,6 +6,7 @@
|
|||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
@ -165,24 +166,13 @@ bool Job::setTarget(const char *target)
|
|||
|
||||
xmrig::Variant Job::variant() const
|
||||
{
|
||||
if (m_algorithm.variant() == xmrig::VARIANT_XTL && m_blob[0] < 4) {
|
||||
return xmrig::VARIANT_1;
|
||||
}
|
||||
|
||||
if (m_algorithm.variant() == xmrig::VARIANT_MSR && m_blob[0] < 7) {
|
||||
return xmrig::VARIANT_1;
|
||||
}
|
||||
|
||||
if (m_algorithm.variant() == xmrig::VARIANT_XHV && m_blob[0] < 3) {
|
||||
return xmrig::VARIANT_0;
|
||||
}
|
||||
|
||||
if (m_algorithm.variant() == xmrig::VARIANT_AUTO) {
|
||||
if (m_algorithm.algo() == xmrig::CRYPTONIGHT_HEAVY) {
|
||||
return xmrig::VARIANT_0;
|
||||
} else if (m_algorithm.algo() == xmrig::CRYPTONIGHT_LITE) {
|
||||
return xmrig::VARIANT_1;
|
||||
}
|
||||
|
||||
return (m_blob[0] >= 8) ? xmrig::VARIANT_2 : xmrig::VARIANT_1;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
@ -22,8 +23,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __JOB_H__
|
||||
#define __JOB_H__
|
||||
#ifndef XMRIG_JOB_H
|
||||
#define XMRIG_JOB_H
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
|
@ -100,4 +101,4 @@ private:
|
|||
# endif
|
||||
};
|
||||
|
||||
#endif /* __JOB_H__ */
|
||||
#endif /* XMRIG_JOB_H */
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
@ -360,7 +361,7 @@ void Pool::adjustVariant(const xmrig::Variant variantHint)
|
|||
if (m_algorithm.algo() == CRYPTONIGHT_HEAVY) {
|
||||
m_algorithm.setVariant(VARIANT_0);
|
||||
}
|
||||
else {
|
||||
else if (m_algorithm.algo() == CRYPTONIGHT_LITE) {
|
||||
m_algorithm.setVariant(VARIANT_1);
|
||||
}
|
||||
# endif
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
@ -21,8 +22,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __POOL_H__
|
||||
#define __POOL_H__
|
||||
#ifndef XMRIG_POOL_H
|
||||
#define XMRIG_POOL_H
|
||||
|
||||
|
||||
#include <vector>
|
||||
|
@ -105,4 +106,4 @@ private:
|
|||
|
||||
typedef std::vector<Pool> Pools;
|
||||
|
||||
#endif /* __POOL_H__ */
|
||||
#endif /* XMRIG_POOL_H */
|
||||
|
|
|
@ -166,9 +166,12 @@ bool Network::isColors() const
|
|||
|
||||
void Network::setJob(Client *client, const Job &job, bool donate)
|
||||
{
|
||||
xmrig::Algorithm algorithm = job.algorithm();
|
||||
algorithm.setVariant(job.variant());
|
||||
|
||||
LOG_INFO(isColors() ? MAGENTA_BOLD("new job") " from " WHITE_BOLD("%s:%d") " diff " WHITE_BOLD("%d") " algo " WHITE_BOLD("%s")
|
||||
: "new job from %s:%d diff %d algo %s",
|
||||
client->host(), client->port(), job.diff(), job.algorithm().shortName());
|
||||
client->host(), client->port(), job.diff(), algorithm.shortName());
|
||||
|
||||
m_state.diff = job.diff();
|
||||
Workers::setJob(job, donate);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
@ -22,8 +23,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __MULTIWORKER_H__
|
||||
#define __MULTIWORKER_H__
|
||||
#ifndef XMRIG_MULTIWORKER_H
|
||||
#define XMRIG_MULTIWORKER_H
|
||||
|
||||
|
||||
#include "common/net/Job.h"
|
||||
|
@ -71,4 +72,4 @@ private:
|
|||
};
|
||||
|
||||
|
||||
#endif /* __MULTIWORKER_H__ */
|
||||
#endif /* XMRIG_MULTIWORKER_H */
|
||||
|
|
Loading…
Reference in a new issue