Cleaned up algo parameter

This commit is contained in:
miketout
2018-04-27 17:03:31 -07:00
parent c0427087eb
commit c62d115425

View File

@@ -1705,19 +1705,14 @@ void komodo_args(char *argv0)
} }
if ( name.c_str()[0] != 0 ) if ( name.c_str()[0] != 0 )
{ {
std:locale loc; std::string selectedAlgo = GetArg("-ac_algo", std::string(ASSETCHAINS_ALGORITHMS[0]));
std::string selectedAlgo = std::tolower(GetArg("-ac_algo", std::string(ASSETCHAINS_ALGORITHMS[0])), loc);
for ( int i = 0; i < ASSETCHAINS_NUMALGOS; i++ ) for ( int i = 0; i < ASSETCHAINS_NUMALGOS; i++ )
{ {
if (std::string(ASSETCHAINS_ALGORITHMS[i]) == selectedAlgo) if (std::string(ASSETCHAINS_ALGORITHMS[i]) == selectedAlgo)
{ {
ASSETCHAINS_ALGO = i; ASSETCHAINS_ALGO = i;
// default is SHA256D, so leave it unless otherwise printf("ASSETCHAINS_ALGO, algorithm set to %s\n", selectedAlgo.c_str());
if (ASSETCHAINS_ALGO == ASSETCHAINS_VERUSHASH)
{
printf("ASSETCHAINS_ALGO, algorithm set to VerusHash\n");
}
break; break;
} }
} }