stratum: check coin filters early (#211)

Avoid the override of global variables
g_stratum_max_cons, g_max_shares, g_stratum_segwit
by excluded coinds by checking the include/exclude filters earlier.
This commit is contained in:
AltMinerNet 2018-01-24 20:35:41 +01:00 committed by Tanguy Pruvot
parent 7aa93d684a
commit e4914a6b09

View file

@ -200,6 +200,17 @@ void db_update_coinds(YAAMP_DB *db)
coind->newcoind = false;
strcpy(coind->name, row[1]);
strcpy(coind->symbol, row[20];
// optional coin filters
if(coind->newcoind) {
bool ignore = false;
if (strlen(g_stratum_coin_include) && !strstr(g_stratum_coin_include, coind->symbol)) ignore = true;
if (strlen(g_stratum_coin_exclude) && strstr(g_stratum_coin_exclude, coind->symbol)) ignore = true;
if (ignore) {
object_delete(coind);
continue;
}
}
if(row[7]) strcpy(coind->wallet, row[7]);
if(row[6]) strcpy(coind->rpcencoding, row[6]);
@ -252,7 +263,6 @@ void db_update_coinds(YAAMP_DB *db)
if(row[18]) coind->charity_percent = atof(row[18]);
if(row[19]) coind->reward_mul = atof(row[19]);
strcpy(coind->symbol, row[20]);
if(row[21]) coind->isaux = atoi(row[21]);
if(row[22] && row[23]) coind->actual_ttf = min(atoi(row[22]), atoi(row[23]));
@ -302,15 +312,6 @@ void db_update_coinds(YAAMP_DB *db)
//coind->touch = true;
if(coind->newcoind)
{
// optional coin filter
bool ignore = false;
if (strlen(g_stratum_coin_include) && !strstr(g_stratum_coin_include, coind->symbol)) ignore = true;
if (strlen(g_stratum_coin_exclude) && strstr(g_stratum_coin_exclude, coind->symbol)) ignore = true;
if (ignore) {
object_delete(coind);
continue;
}
debuglog("connecting to coind %s\n", coind->symbol);
bool b = rpc_connect(&coind->rpc);