jl777 7 years ago
parent
commit
a829b2006b
  1. 6
      iguana/exchanges/LP_rpc.c
  2. 18
      iguana/exchanges/LP_utxos.c

6
iguana/exchanges/LP_rpc.c

@ -60,6 +60,8 @@ char *issue_LP_getpeers(char *destip,uint16_t destport,char *ipaddr,uint16_t por
char *issue_LP_numutxos(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) char *issue_LP_numutxos(char *destip,uint16_t destport,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos)
{ {
char url[512],*retstr; char url[512],*retstr;
printf("deprecated issue_LP_numutxos\n");
return(0);
sprintf(url,"http://%s:%u/api/stats/numutxos?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos); sprintf(url,"http://%s:%u/api/stats/numutxos?ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,numpeers,numutxos);
retstr = LP_issue_curl("numutxos",destip,port,url); retstr = LP_issue_curl("numutxos",destip,port,url);
//printf("%s -> getpeers.(%s)\n",destip,retstr); //printf("%s -> getpeers.(%s)\n",destip,retstr);
@ -69,6 +71,8 @@ char *issue_LP_numutxos(char *destip,uint16_t destport,char *ipaddr,uint16_t por
char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos) char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,char *ipaddr,uint16_t port,int32_t numpeers,int32_t numutxos)
{ {
char url[512]; char url[512];
printf("deprecated issue_LP_getutxos\n");
return(0);
sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,coin,lastn,ipaddr,port,numpeers,numutxos); sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=%s&port=%u&numpeers=%d&numutxos=%d",destip,destport,coin,lastn,ipaddr,port,numpeers,numutxos);
return(LP_issue_curl("getutxos",destip,destport,url)); return(LP_issue_curl("getutxos",destip,destport,url));
//return(issue_curlt(url,LP_HTTP_TIMEOUT)); //return(issue_curlt(url,LP_HTTP_TIMEOUT));
@ -77,6 +81,8 @@ char *issue_LP_getutxos(char *destip,uint16_t destport,char *coin,int32_t lastn,
char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t lastn) char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t lastn)
{ {
char url[512];//,*retstr; char url[512];//,*retstr;
printf("deprecated issue_LP_clientgetutxos\n");
return(0);
sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=127.0.0.1&port=0",destip,destport,coin,lastn); sprintf(url,"http://%s:%u/api/stats/getutxos?coin=%s&lastn=%d&ipaddr=127.0.0.1&port=0",destip,destport,coin,lastn);
return(LP_issue_curl("clientgetutxos",destip,destport,url)); return(LP_issue_curl("clientgetutxos",destip,destport,url));
//retstr = issue_curlt(url,LP_HTTP_TIMEOUT); //retstr = issue_curlt(url,LP_HTTP_TIMEOUT);

18
iguana/exchanges/LP_utxos.c

@ -587,24 +587,6 @@ int32_t LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipa
retval = LP_utxosparse(destipaddr,destport,retstr,now); retval = LP_utxosparse(destipaddr,destport,retstr,now);
//printf("got.(%s)\n",retstr); //printf("got.(%s)\n",retstr);
free(retstr); free(retstr);
/*i = 0;
if ( lastn >= mypeer->numutxos )
firsti = -1;
else firsti = (mypeer->numutxos - lastn);
HASH_ITER(hh,LP_utxoinfos,utxo,tmp)
{
if ( i++ < firsti )
continue;
if ( utxo->lasttime != now && strcmp(utxo->ipaddr,"127.0.0.1") != 0 )
{
char str[65]; printf("{%s:%u %s} ",utxo->ipaddr,utxo->port,bits256_str(str,utxo->txid));
flag++;
if ( (retstr= issue_LP_notifyutxo(destipaddr,destport,utxo)) != 0 )
free(retstr);
}
}
if ( flag != 0 )
printf(" <- missing utxos\n");*/
} }
return(retval); return(retval);
} }

Loading…
Cancel
Save