mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-31 17:21:26 +00:00
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:
parent
7aa93d684a
commit
e4914a6b09
1 changed files with 11 additions and 10 deletions
|
@ -200,6 +200,17 @@ void db_update_coinds(YAAMP_DB *db)
|
||||||
coind->newcoind = false;
|
coind->newcoind = false;
|
||||||
|
|
||||||
strcpy(coind->name, row[1]);
|
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[7]) strcpy(coind->wallet, row[7]);
|
||||||
if(row[6]) strcpy(coind->rpcencoding, row[6]);
|
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[18]) coind->charity_percent = atof(row[18]);
|
||||||
if(row[19]) coind->reward_mul = atof(row[19]);
|
if(row[19]) coind->reward_mul = atof(row[19]);
|
||||||
|
|
||||||
strcpy(coind->symbol, row[20]);
|
|
||||||
if(row[21]) coind->isaux = atoi(row[21]);
|
if(row[21]) coind->isaux = atoi(row[21]);
|
||||||
|
|
||||||
if(row[22] && row[23]) coind->actual_ttf = min(atoi(row[22]), atoi(row[23]));
|
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;
|
//coind->touch = true;
|
||||||
if(coind->newcoind)
|
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);
|
debuglog("connecting to coind %s\n", coind->symbol);
|
||||||
|
|
||||||
bool b = rpc_connect(&coind->rpc);
|
bool b = rpc_connect(&coind->rpc);
|
||||||
|
|
Loading…
Add table
Reference in a new issue