|
|
@ -53,7 +53,7 @@ cJSON *bitcoin_json(struct iguana_info *coin,char *method,char *params) |
|
|
|
// printf("issue.(%s, %s, %s, %s, %s)\n",coin->symbol,coin->serverport,coin->userpass,method,params);
|
|
|
|
if ( coin->electrum != 0 && (strcmp(method,"getblock") == 0 || strcmp(method,"paxprice") == 0 || strcmp(method,"getrawmempool") == 0) ) |
|
|
|
return(cJSON_Parse("{\"error\":\"illegal electrum call\"}")); |
|
|
|
if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 ) |
|
|
|
if ( coin->inactive == 0 || strcmp(method,"importprivkey") == 0 || strcmp(method,"validateaddress") == 0 || strcmp(method,"getaddressinfo") == 0 || strcmp(method,"getrawtransaction") == 0 || strcmp(method,"getblock") == 0 || strcmp(method,"getinfo") == 0 || strcmp(method,"getblockchaininfo") == 0 ) |
|
|
|
{ |
|
|
|
if ( coin->electrum == 0 ) |
|
|
|
{ |
|
|
@ -344,7 +344,17 @@ cJSON *LP_validateaddress(char *symbol,char *address) |
|
|
|
else |
|
|
|
{ |
|
|
|
sprintf(buf,"[\"%s\"]",address); |
|
|
|
return(bitcoin_json(coin,"validateaddress",buf)); |
|
|
|
if ( (retjson= bitcoin_json(coin,coin->validateaddress,buf)) != 0 ) |
|
|
|
{ |
|
|
|
if ( jobj(retjson,"ismine") == 0 && strcmp(coin->validateaddress,"validateaddress") == 0 ) |
|
|
|
{ |
|
|
|
printf("autochange validateaddress -> getaddressinfo\n",coin->symbol); |
|
|
|
strcpy(coin->validateaddress,"getaddressinfo"); |
|
|
|
free(retjson); |
|
|
|
return(bitcoin_json(coin,coin->validateaddress,buf)); |
|
|
|
} |
|
|
|
} |
|
|
|
return(retjson); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|