Browse Source

Test

etomic
jl777 7 years ago
parent
commit
8cd733469a
  1. 4
      iguana/exchanges/LP_commands.c
  2. 12
      iguana/exchanges/LP_utxo.c

4
iguana/exchanges/LP_commands.c

@ -557,7 +557,9 @@ bot_resume(botid)\n\
//printf("network invoked\n");
LP_privkey_init(-1,ptr,G.LP_privkey,G.LP_mypub25519);
//LP_smartutxos_push(ptr);
return(jprint(LP_address_utxos(ptr,coinaddr,1),1));
if ( ptr->electrum != 0 )
return(LP_unspents_filestr(coin,ptr->smartaddr));
else return(jprint(LP_address_utxos(ptr,coinaddr,1),1));
}
else
{

12
iguana/exchanges/LP_utxo.c

@ -1087,13 +1087,19 @@ void LP_unspents_cache(char *symbol,char *addr,char *arraystr,int32_t updatedfla
}
}
char *LP_unspents_filestr(char *symbol,char *addr)
{
char fname[1024]; long fsize;
sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname);
return(OS_filestr(&fsize,fname));
}
uint64_t LP_unspents_load(char *symbol,char *addr)
{
char fname[1024],*arraystr; uint64_t balance = 0; int32_t i,n; long fsize; struct iguana_info *coin; cJSON *retjson,*item;
char *arraystr; uint64_t balance = 0; int32_t i,n; cJSON *retjson,*item; struct iguana_info *coin;
if ( (coin= LP_coinfind(symbol)) != 0 )
{
sprintf(fname,"%s/UNSPENTS/%s_%s",GLOBAL_DBDIR,symbol,addr), OS_portable_path(fname);
if ( (arraystr= OS_filestr(&fsize,fname)) != 0 )
if ( (arraystr= LP_unspents_filestr(symbol,addr)) != 0 )
{
if ( (retjson= cJSON_Parse(arraystr)) != 0 )
{

Loading…
Cancel
Save