jl777 7 years ago
parent
commit
e63b4c4480
  1. 2
      iguana/exchanges/LP_rpc.c
  2. 12
      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;
sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr);
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 )
{
array = cJSON_CreateArray();

12
iguana/exchanges/LP_utxo.c

@ -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
{

Loading…
Cancel
Save