From 16b4fd0ff5a2734a0a7defc2efe8e3c1e7bf92c0 Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 9 Jan 2019 21:47:03 +0700 Subject: [PATCH] Update variant detection for nicehash.com and minergate.com. --- src/common/net/Pool.cpp | 36 ++++++++++++++++++++++++++---------- src/common/net/Pool.h | 2 +- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/common/net/Pool.cpp b/src/common/net/Pool.cpp index 089a87279..b9a50ae8b 100644 --- a/src/common/net/Pool.cpp +++ b/src/common/net/Pool.cpp @@ -6,7 +6,7 @@ * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , * Copyright 2018 SChernykh - * Copyright 2016-2018 XMRig , + * Copyright 2016-2019 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 @@ -322,23 +322,39 @@ void Pool::adjustVariant(const xmrig::Variant variantHint) m_nicehash = true; bool valid = true; - if (m_host.contains("cryptonight.") && m_port == 3355) { - valid = m_algorithm.algo() == CRYPTONIGHT; + switch (m_port) { + case 3355: + case 33355: + valid = m_algorithm.algo() == CRYPTONIGHT && m_host.contains("cryptonight."); m_algorithm.setVariant(VARIANT_0); - } - else if (m_host.contains("cryptonightv7.") && m_port == 3363) { - valid = m_algorithm.algo() == CRYPTONIGHT; + break; + + case 3363: + case 33363: + valid = m_algorithm.algo() == CRYPTONIGHT && m_host.contains("cryptonightv7."); m_algorithm.setVariant(VARIANT_1); - } - else if (m_host.contains("cryptonightheavy.") && m_port == 3364) { - valid = m_algorithm.algo() == CRYPTONIGHT_HEAVY; + break; + + case 3364: + valid = m_algorithm.algo() == CRYPTONIGHT_HEAVY && m_host.contains("cryptonightheavy."); m_algorithm.setVariant(VARIANT_0); + break; + + case 3367: + case 33367: + valid = m_algorithm.algo() == CRYPTONIGHT && m_host.contains("cryptonightv8."); + m_algorithm.setVariant(VARIANT_2); + break; + + default: + break; } if (!valid) { m_algorithm.setAlgo(INVALID_ALGO); } + m_tls = m_port > 33000; return; } @@ -349,7 +365,7 @@ void Pool::adjustVariant(const xmrig::Variant variantHint) if (m_host.contains("xmr.pool.")) { valid = m_algorithm.algo() == CRYPTONIGHT; - m_algorithm.setVariant(m_port == 45700 ? VARIANT_2 : VARIANT_0); + m_algorithm.setVariant(m_port == 45700 ? VARIANT_AUTO : VARIANT_0); } else if (m_host.contains("aeon.pool.") && m_port == 45690) { valid = m_algorithm.algo() == CRYPTONIGHT_LITE; diff --git a/src/common/net/Pool.h b/src/common/net/Pool.h index 123cc131f..c051b0ee2 100644 --- a/src/common/net/Pool.h +++ b/src/common/net/Pool.h @@ -6,7 +6,7 @@ * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , * Copyright 2018 SChernykh - * Copyright 2016-2018 XMRig , + * Copyright 2016-2019 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