From 9fc67c9b2493f775f98a27fe12ca727331a4c354 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 10 Nov 2017 23:03:22 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_cache.c | 4 +++- iguana/exchanges/LP_coins.c | 1 - iguana/exchanges/LP_socket.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_cache.c b/iguana/exchanges/LP_cache.c index 2fa3f6d69..bcca92a86 100644 --- a/iguana/exchanges/LP_cache.c +++ b/iguana/exchanges/LP_cache.c @@ -131,6 +131,7 @@ void LP_cacheptrs_init(struct iguana_info *coin) char fname[1024]; FILE *fp; int32_t tflag=0; long n,fsize=0,len = 0; sprintf(fname,"%s/UNSPENTS/%s.SPV",GLOBAL_DBDIR,coin->symbol), OS_portable_path(fname); fp = fopen(fname,"rb"); + printf("load %s\n",fname); if ( fp != 0 ) { fseek(fp,0,SEEK_END); @@ -145,8 +146,9 @@ void LP_cacheptrs_init(struct iguana_info *coin) break; } len += n; - printf("len.%ld n.%ld\n",len,n); + printf("%s len.%ld n.%ld\n",fname,len,n); } + fclose(fp); } else printf("couldnt find.(%s)\n",fname); if ( tflag != 0 ) OS_truncate(fname,len); diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index 69bf86302..38c62ac64 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -353,7 +353,6 @@ uint16_t LP_coininit(struct iguana_info *coin,char *symbol,char *name,char *asse coin->zcash = LP_IS_BITCOINCASH; //printf("set coin.%s <- LP_IS_BITCOINCASH %d\n",symbol,coin->zcash); } - LP_cacheptrs_init(coin); return(port); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index c34c04ee7..8435aa6df 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -1056,7 +1056,8 @@ cJSON *LP_electrumserver(struct iguana_info *coin,char *ipaddr,uint16_t port) { printf("launched %s electrum.(%s:%u)\n",coin->symbol,ep->ipaddr,ep->port); jaddstr(retjson,"result","success"); - ep->prev = coin->electrum; + if ( (ep->prev= coin->electrum) == 0 ) + LP_cacheptrs_init(coin); coin->electrum = ep; } }