Browse Source

Test

etomic
jl777 7 years ago
parent
commit
2f49790046
  1. 2
      iguana/exchanges/LP_rpc.c
  2. 9
      iguana/exchanges/LP_utxos.c

2
iguana/exchanges/LP_rpc.c

@ -52,7 +52,7 @@ char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t
{ {
char url[512]; char url[512];
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);
//printf("getutxo.(%s)\n",url); printf("getutxo.(%s)\n",url);
return(issue_curlt(url,LP_HTTP_TIMEOUT)); return(issue_curlt(url,LP_HTTP_TIMEOUT));
} }

9
iguana/exchanges/LP_utxos.c

@ -476,12 +476,15 @@ void LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr
peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport);
if ( coin == 0 ) if ( coin == 0 )
coin = ""; coin = "";
printf("utxo query.(%s)\n",destipaddr); //printf("utxo query.(%s)\n",destipaddr);
if ( (retstr= issue_LP_getutxos(destipaddr,destport,coin,lastn,myipaddr,myport,myprofit,mypeer != 0 ? mypeer->numpeers : 0,mypeer != 0 ? mypeer->numutxos : 0)) != 0 ) if ( IAMLP != 0 )
retstr = issue_LP_getutxos(destipaddr,destport,coin,lastn,myipaddr,myport,myprofit,mypeer != 0 ? mypeer->numpeers : 0,mypeer != 0 ? mypeer->numutxos : 0);
else retstr = issue_LP_clientgetutxos(destipaddr,destport,coin,100);
if ( retstr != 0 )
{ {
now = (uint32_t)time(NULL); now = (uint32_t)time(NULL);
LP_utxosparse(mypubsock,destipaddr,destport,retstr,now); LP_utxosparse(mypubsock,destipaddr,destport,retstr,now);
printf("got.(%s)\n",retstr); //printf("got.(%s)\n",retstr);
free(retstr); free(retstr);
/*i = 0; /*i = 0;
if ( lastn >= mypeer->numutxos ) if ( lastn >= mypeer->numutxos )

Loading…
Cancel
Save