|
|
@ -375,11 +375,23 @@ cJSON *dpow_getblock(struct supernet_info *myinfo,struct iguana_info *coin,bits2 |
|
|
|
|
|
|
|
char *dpow_validateaddress(struct supernet_info *myinfo,struct iguana_info *coin,char *address) |
|
|
|
{ |
|
|
|
char buf[128],*retstr=0; |
|
|
|
char buf[128],*retstr=0; cJSON *retjson; |
|
|
|
if ( coin->FULLNODE < 0 ) |
|
|
|
{ |
|
|
|
sprintf(buf,"\"%s\"",address); |
|
|
|
retstr = bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"validateaddress",buf); |
|
|
|
retstr = bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,coin->validateaddress,buf); |
|
|
|
if ( (retjson= cJSON_Parse(retstr)) != 0 ) |
|
|
|
{ |
|
|
|
if ( strcmp(coin->symbol,"BTC") == 0 && jobj(retjson,"error") == 0 && jobj(retjson,"ismine") == 0 && strcmp(coin->validateaddress,"validateaddress") == 0 ) |
|
|
|
{ |
|
|
|
printf("autochange %s validateaddress -> getaddressinfo\n",coin->symbol); |
|
|
|
strcpy(coin->validateaddress,"getaddressinfo"); |
|
|
|
free_json(retjson); |
|
|
|
free(retjson); |
|
|
|
return(bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,coin->validateaddress,buf)); |
|
|
|
} |
|
|
|
free_json(retjson); |
|
|
|
} |
|
|
|
usleep(10000); |
|
|
|
} |
|
|
|
else if ( coin->FULLNODE > 0 || coin->VALIDATENODE > 0 ) |
|
|
|