Browse Source

Merge pull request #803 from jl777/jl777

BTC 0.16 support for deprecated validate address
patch-3
jl777 7 years ago
committed by GitHub
parent
commit
a5121fc60c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      iguana/dpow/dpow_rpc.c
  2. 2
      iguana/iguana777.c
  3. 2
      includes/iguana_structs.h

16
iguana/dpow/dpow_rpc.c

@ -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 )

2
iguana/iguana777.c

@ -49,6 +49,8 @@ struct iguana_info *iguana_coinadd(char *symbol,char *name,cJSON *argjson,int32_
myinfo->allcoins_being_added = 1;
coin = mycalloc('C',1,sizeof(*coin));
strcpy(coin->getinfostr,"getinfo");
strcpy(coin->validateaddress,"validateaddress");
strcpy(coin->estimatefeestr,"estimatefee");
coin->blockspacesize = IGUANA_MAXPACKETSIZE + 8192;
coin->blockspace = calloc(1,coin->blockspacesize);
if ( virtcoin != 0 || ((privatechain= jstr(argjson,"geckochain")) != 0 && privatechain[0] != 0) )

2
includes/iguana_structs.h

@ -528,7 +528,7 @@ struct iguana_info
#ifdef DEPRECATED_HHUTXO
struct iguana_hhaccount *accountstable;
#endif
char lastdispstr[2048],getinfostr[64];
char lastdispstr[2048],getinfostr[64],validateaddress[64],estimatefeestr[64];
double txidfind_totalmillis,txidfind_num,spendtxid_totalmillis,spendtxid_num;
struct iguana_monitorinfo monitoring[256];
int32_t notarychain,didaddresses;

Loading…
Cancel
Save