Skip to content

Commit

Permalink
stratum: handle ismine check moved in getaddressinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed May 25, 2018
1 parent 2b932a8 commit afc80e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion stratum/coind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ bool coind_validate_address(YAAMP_COIND *coind)
char params[YAAMP_SMALLBUFSIZE];
sprintf(params, "[\"%s\"]", coind->wallet);

json_value *json = rpc_call(&coind->rpc, "validateaddress", params);
// assume, if the wallet has dropped getinfo, that it use the new getaddressinfo rpc for ismine and account
json_value *json = rpc_call(&coind->rpc, coind->hasgetinfo ? "validateaddress" : "getaddressinfo", params);
if(!json) return false;

json_value *json_result = json_get_object(json, "result");
Expand Down
2 changes: 1 addition & 1 deletion stratum/coind.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class YAAMP_COIND: public YAAMP_OBJECT
bool hasmasternodes;
bool oldmasternodes;
bool multialgos; // pow_hash field (or mined_hash)

bool hasgetinfo;
bool usesegwit;
char commitment[128];
char witness_magic[16];
Expand Down
3 changes: 2 additions & 1 deletion stratum/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void db_update_coinds(YAAMP_DB *db)
db_query(db, "SELECT id, name, rpchost, rpcport, rpcuser, rpcpasswd, rpcencoding, master_wallet, reward, price, "
"hassubmitblock, txmessage, enable, auto_ready, algo, pool_ttf, charity_address, charity_amount, charity_percent, "
"reward_mul, symbol, auxpow, actual_ttf, network_ttf, usememorypool, hasmasternodes, algo, symbol2, "
"rpccurl, rpcssl, rpccert, account, multialgos, max_miners, max_shares, usesegwit "
"rpccurl, rpcssl, rpccert, account, multialgos, max_miners, max_shares, usesegwit, hasgetinfo "
"FROM coins WHERE enable AND auto_ready AND algo='%s' ORDER BY index_avg", g_stratum_algo);

MYSQL_RES *result = mysql_store_result(&db->mysql);
Expand Down Expand Up @@ -304,6 +304,7 @@ void db_update_coinds(YAAMP_DB *db)
if(row[33] && atoi(row[33]) > 0) g_stratum_max_cons = atoi(row[33]);
if(row[34] && atol(row[34]) > 0) g_max_shares = atol(row[34]);
if(row[35]) coind->usesegwit = atoi(row[35]) > 0;
if(row[36]) coind->hasgetinfo = atoi(row[36]) > 0;

if(coind->usesegwit) g_stratum_segwit = true;

Expand Down

0 comments on commit afc80e2

Please sign in to comment.