Browse Source

Test

etomic
jl777 8 years ago
parent
commit
f908bb0c8c
  1. 3
      iguana/exchanges/LP_nativeDEX.c
  2. 7
      iguana/exchanges/LP_rpc.c

3
iguana/exchanges/LP_nativeDEX.c

@ -344,7 +344,6 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer)
printf("n.%d total %.8f\n",n,dstr(total)); printf("n.%d total %.8f\n",n,dstr(total));
if ( n > 0 && total > 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 ) if ( n > 0 && total > 0 && (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,coin->smartaddr)) != 0 )
{ {
printf("%s -> (%s)\n",peer->ipaddr,retstr);
total2 = 0; total2 = 0;
if ( (array2= cJSON_Parse(retstr)) != 0 ) if ( (array2= cJSON_Parse(retstr)) != 0 )
{ {
@ -383,7 +382,7 @@ int32_t LP_utxos_sync(struct LP_peerinfo *peer)
} else printf("parse error (%s)\n",retstr); } else printf("parse error (%s)\n",retstr);
free(retstr); free(retstr);
} }
else if ( n == 0 && total == 0 ) else if ( n != 0 && total != 0 )
printf("no response from %s for %s\n",peer->ipaddr,coin->symbol); printf("no response from %s for %s\n",peer->ipaddr,coin->symbol);
} }
if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 ) if ( (retstr= issue_LP_listunspent(peer->ipaddr,peer->port,coin->symbol,"")) != 0 )

7
iguana/exchanges/LP_rpc.c

@ -94,10 +94,11 @@ char *issue_LP_getprices(char *destip,uint16_t destport)
char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coinaddr) char *issue_LP_listunspent(char *destip,uint16_t destport,char *symbol,char *coinaddr)
{ {
char url[512]; char url[512],*retstr;
sprintf(url,"http://%s:%u/api/stats/listunspent?coin=%s&address=%s",destip,destport,symbol,coinaddr); sprintf(url,"http://%s:%u/api/stats/listunspent?coin=%s&address=%s",destip,destport,symbol,coinaddr);
//printf("listunspent.(%s)\n",url); retstr = LP_issue_curl("listunspent",destip,destport,url);
return(LP_issue_curl("listunspent",destip,destport,url)); printf("listunspent.(%s) -> (%s)\n",url,retstr);
return(retstr);
} }
char *LP_apicall(struct iguana_info *coin,char *method,char *params) char *LP_apicall(struct iguana_info *coin,char *method,char *params)

Loading…
Cancel
Save