From 67e3685936c69e8bc75ce640803d1e6268051123 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 2 Jul 2017 17:23:56 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 8 +++++--- iguana/exchanges/LP_scan.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 95a909c89..c9c0be3cc 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -337,16 +337,18 @@ int32_t LP_mainloop_iter(void *ctx,char *myipaddr,struct LP_peerinfo *mypeer,int { cJSON *obj; int32_t height; bits256 zero; //printf("%s ref.%d scan.%d to %d, longest.%d\n",coin->symbol,coin->firstrefht,coin->firstscanht,coin->lastscanht,coin->longestchain); + if ( coin->inactive != 0 ) + continue; memset(zero.bytes,0,sizeof(zero)); if ( time(NULL) > coin->lastgetinfo+LP_GETINFO_INCR ) { if ( (obj= LP_getinfo(coin->symbol)) != 0 ) { - if ( (height= jint(obj,"blocks")) > coin->longestchain ) + if ( (height= jint(obj,"blocks")) >= coin->longestchain ) { - coin->longestchain = height; + coin->longestchain = height - 1; printf(">>>>>>>>>> set %s longestchain %d (ref.%d [%d, %d])\n",coin->symbol,height,coin->firstrefht,coin->firstscanht,coin->lastscanht); - } else printf("cant find blocks in (%s)\n",jprint(obj,0)); + } free_json(obj); } else printf("error getting info.%s\n",coin->symbol); coin->lastgetinfo = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_scan.c b/iguana/exchanges/LP_scan.c index 1bc588e0e..af859465f 100644 --- a/iguana/exchanges/LP_scan.c +++ b/iguana/exchanges/LP_scan.c @@ -58,7 +58,7 @@ int32_t LP_txheight(uint32_t *timestampp,uint32_t *blocktimep,struct iguana_info if ( bits256_nonz(blockhash) != 0 && (blockobj= LP_getblock(coin->symbol,blockhash)) != 0 ) { height = jint(blockobj,"height"); - printf("LP_txheight.%d\n",height); + printf("%s LP_txheight.%d\n",coin->symbol,height); free_json(blockobj); } else printf("LP_txheight error (%s)\n",jprint(txobj,0)); return(height);