From 05b4976d55f4ec710d80a8d603c39c29ea901dbe Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Sun, 2 Dec 2018 23:14:02 +0100 Subject: [PATCH] fix default interleave value The default value for interleave was wrongly set to 50. Remove the value and take the devault from the default constructor instead of side channeling it from the json parser. --- xmrstak/backend/amd/jconf.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/xmrstak/backend/amd/jconf.cpp b/xmrstak/backend/amd/jconf.cpp index e4da91ca1..0ee3304bc 100644 --- a/xmrstak/backend/amd/jconf.cpp +++ b/xmrstak/backend/amd/jconf.cpp @@ -122,21 +122,22 @@ bool jconf::GetThreadConfig(size_t id, thd_cfg &cfg) return false; // interleave is optional - if(interleave == nullptr) - cfg.interleave = 50; - else if(!interleave->IsUint64()) + if(interleave != nullptr) { - printer::inst()->print_msg(L0, "ERROR: interleave must be a number"); - return false; - } - else if((int)interleave->GetInt64() < 0 || (int)interleave->GetInt64() > 100) - { - printer::inst()->print_msg(L0, "ERROR: interleave must be in range [0;100]"); - return false; - } - else - { - cfg.interleave = (int)interleave->GetInt64(); + if(!interleave->IsInt()) + { + printer::inst()->print_msg(L0, "ERROR: interleave must be a number"); + return false; + } + else if(interleave->GetInt() < 0 || interleave->GetInt() > 100) + { + printer::inst()->print_msg(L0, "ERROR: interleave must be in range [0;100]"); + return false; + } + else + { + cfg.interleave = interleave->GetInt(); + } } if(!idx->IsUint64() || !intensity->IsUint64() || !w_size->IsUint64())