|
|
@ -668,7 +668,7 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr |
|
|
|
{ |
|
|
|
cJSON *array,*retjson,*item; bits256 zero; int32_t i,n; uint64_t balance = 0; |
|
|
|
memset(zero.bytes,0,sizeof(zero)); |
|
|
|
printf("address balance call LP_listunspent %s electrum.%p etomic.%d\n",coin->symbol,coin->electrum,coin->etomic[0]); |
|
|
|
//printf("address balance call LP_listunspent %s electrum.%p etomic.%d\n",coin->symbol,coin->electrum,coin->etomic[0]);
|
|
|
|
#ifndef NOTETOMIC |
|
|
|
if (coin->etomic[0] != 0) { |
|
|
|
balance = LP_etomic_get_balance(coin, coinaddr); |
|
|
@ -678,21 +678,21 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr |
|
|
|
{ |
|
|
|
if ( (array= LP_listunspent(coin->symbol,coinaddr,zero,zero)) != 0 ) |
|
|
|
{ |
|
|
|
printf("got address balance (%s)\n",jprint(array,0)); |
|
|
|
//printf("got address balance (%s)\n",jprint(array,0));
|
|
|
|
if ( (n= cJSON_GetArraySize(array)) > 0 ) |
|
|
|
{ |
|
|
|
for (i=0; i<n; i++) |
|
|
|
{ |
|
|
|
item = jitem(array,i); |
|
|
|
balance += LP_value_extract(item,1); |
|
|
|
printf("i.%d (%s) balance %.8f\n",i,jprint(item,0),dstr(balance)); |
|
|
|
//printf("i.%d (%s) balance %.8f\n",i,jprint(item,0),dstr(balance));
|
|
|
|
} |
|
|
|
} |
|
|
|
free_json(array); |
|
|
|
} |
|
|
|
uint64_t balance3,balance2 = LP_balance(&balance2,0,coin->symbol,coin->smartaddr); |
|
|
|
balance3 = LP_RTsmartbalance(coin); |
|
|
|
printf("balance %.8f vs balance2 %.8f vs balance3 %.8f\n",dstr(balance),dstr(balance2),dstr(balance3)); |
|
|
|
//uint64_t balance3,balance2 = LP_balance(&balance2,0,coin->symbol,coin->smartaddr);
|
|
|
|
//balance3 = LP_RTsmartbalance(coin);
|
|
|
|
//printf("balance %.8f vs balance2 %.8f vs balance3 %.8f\n",dstr(balance),dstr(balance2),dstr(balance3));
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|