From 8cd733469a00f60536503170226d702248be25d6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Nov 2017 02:14:39 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 4 +++- iguana/exchanges/LP_utxo.c | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index af12cb1c2..7de090f22 100644 --- a/iguana/exchanges/LP_commands.c +++ b/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 { diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 4cbe86e58..161e19502 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/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 ) {