From 189cc78d44c77f9f362895228592167541725130 Mon Sep 17 00:00:00 2001 From: cohcho Date: Fri, 25 Sep 2020 17:25:23 +0000 Subject: [PATCH] Miner: filter invalid algos --- src/base/crypto/Algorithm.h | 2 +- src/core/Miner.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/crypto/Algorithm.h b/src/base/crypto/Algorithm.h index b04765d52..186dd77eb 100644 --- a/src/base/crypto/Algorithm.h +++ b/src/base/crypto/Algorithm.h @@ -96,7 +96,7 @@ public: inline bool isCN() const { auto f = family(); return f == CN || f == CN_LITE || f == CN_HEAVY || f == CN_PICO; } inline bool isEqual(const Algorithm &other) const { return m_id == other.m_id; } - inline bool isValid() const { return m_id != INVALID; } + inline bool isValid() const { return m_id != INVALID && family() != UNKNOWN; } inline const char *name() const { return name(false); } inline const char *shortName() const { return name(true); } inline Family family() const { return family(m_id); } diff --git a/src/core/Miner.cpp b/src/core/Miner.cpp index 12be05ecc..f4edfa975 100644 --- a/src/core/Miner.cpp +++ b/src/core/Miner.cpp @@ -121,7 +121,7 @@ public: for (int i = 0; i < Algorithm::MAX; ++i) { const Algorithm algo(static_cast(i)); - if (isEnabled(algo)) { + if (algo.isValid() && isEnabled(algo)) { algorithms.push_back(algo); } }