Better algorithm validation.

This commit is contained in:
XMRig 2018-04-25 22:03:26 +07:00
parent a9cc5c5258
commit 230962230f
3 changed files with 29 additions and 2 deletions

View file

@ -79,6 +79,22 @@ static const char *variants[] = {
};
bool xmrig::Algorithm::isValid() const
{
if (m_algo == INVALID_ALGO) {
return false;
}
for (size_t i = 0; i < ARRAY_SIZE(algorithms); i++) {
if (algorithms[i].algo == m_algo && algorithms[i].variant == m_variant) {
return true;
}
}
return false;
}
const char *xmrig::Algorithm::variantName() const
{
if (m_variant == VARIANT_AUTO) {