From 6ca9d6518336ea54356aec33199080c00d95a694 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 19 Sep 2017 20:15:58 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_rpc.c | 6 +++--- iguana/exchanges/LP_utxo.c | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index 8f3924833..bb5c6d347 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -549,7 +549,7 @@ cJSON *LP_importprivkey(char *symbol,char *wifstr,char *label,int32_t flag) int32_t LP_importaddress(char *symbol,char *address) { - char buf[1024],*retstr; cJSON *validatejson,*retjson; int32_t isvalid=0,doneflag = 0; struct iguana_info *coin; + char buf[1024],*retstr; cJSON *validatejson; int32_t isvalid=0,doneflag = 0; struct iguana_info *coin; if ( symbol == 0 || symbol[0] == 0 ) return(-2); coin = LP_coinfind(symbol); @@ -557,11 +557,11 @@ int32_t LP_importaddress(char *symbol,char *address) return(-2); if ( coin->electrum != 0 ) { - if ( (retjson= electrum_address_subscribe(symbol,coin->electrum,&retjson,address)) != 0 ) + /*if ( (retjson= electrum_address_subscribe(symbol,coin->electrum,&retjson,address)) != 0 ) { printf("importaddress.(%s) -> %s\n",address,jprint(retjson,0)); free_json(retjson); - } + }*/ return(0); } else diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index f55b13f5a..52ba64e71 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -531,9 +531,12 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int else { if ( (ht= LP_txheight(coin,txid)) > 0 && ht <= coin->height ) - numconfirms = (coin->height - ht); - else if ( mempool != 0 && LP_waitmempool(symbol,coinaddr,txid,-1) >= 0 ) - numconfirms = 0; + numconfirms = (LP_getheight(coin) - ht); + else if ( mempool != 0 ) + { + if (LP_waitmempool(symbol,coinaddr,txid,30) >= 0 ) + numconfirms = 0; + } } //#endif return(numconfirms);