jl777 7 years ago
parent
commit
c1d7ff1dcb
  1. 2
      iguana/exchanges/LP_rpc.c
  2. 3
      iguana/exchanges/LP_utxo.c

2
iguana/exchanges/LP_rpc.c

@ -434,7 +434,7 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr,bits256 reftxid,bits256 reftxi
else numconfs = 1; else numconfs = 1;
sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr);
retjson = bitcoin_json(coin,"listunspent",buf); retjson = bitcoin_json(coin,"listunspent",buf);
printf("LP_listunspent.(%s %s) -> %s\n",symbol,coinaddr,jprint(retjson,0)); //printf("LP_listunspent.(%s %s) -> %s\n",symbol,coinaddr,jprint(retjson,0));
if ( (n= cJSON_GetArraySize(retjson)) > 0 ) if ( (n= cJSON_GetArraySize(retjson)) > 0 )
{ {
array = cJSON_CreateArray(); array = cJSON_CreateArray();

3
iguana/exchanges/LP_utxo.c

@ -677,6 +677,7 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr
{ {
if ( (array= LP_listunspent(coin->symbol,coinaddr,zero,zero)) != 0 ) if ( (array= LP_listunspent(coin->symbol,coinaddr,zero,zero)) != 0 )
{ {
printf("got address balance (%s)\n",jprint(array,0));
if ( (n= cJSON_GetArraySize(array)) > 0 ) if ( (n= cJSON_GetArraySize(array)) > 0 )
{ {
for (i=0; i<n; i++) for (i=0; i<n; i++)
@ -688,6 +689,8 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr
} }
free_json(array); free_json(array);
} }
uint64_t balance2 = LP_balance(&balance2,0,coin->symbol,coin->coinaddr);
printf("balance %.8f vs balance2 %.8f\n",dstr(balance),dstr(balance2));
} }
else else
{ {

Loading…
Cancel
Save