Skip to content

Commit

Permalink
Merge pull request #2115 from psychocrypt/fix-defaultInterleave
Browse files Browse the repository at this point in the history
fix default interleave value
  • Loading branch information
fireice-uk authored Dec 3, 2018
2 parents 240b97e + 05b4976 commit 6765ef4
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions xmrstak/backend/amd/jconf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,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())
Expand Down

0 comments on commit 6765ef4

Please sign in to comment.