From bfb02173da98d96063021758644635f180291e9f Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Oct 2017 17:38:26 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_socket.c | 4 ++++ iguana/exchanges/LP_utxo.c | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f91916e73..b49cbcd17 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -167,7 +167,7 @@ struct LP_address *_LP_addressadd(struct iguana_info *coin,char *coinaddr) ap->pubkey = pubp->pubkey; memcpy(ap->pubsecp,pubp->pubsecp,sizeof(ap->pubsecp)); } - //printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); + printf("LP_ADDRESS %s ADD.(%s)\n",coin->symbol,coinaddr); HASH_ADD_KEYPTR(hh,coin->addresses,ap->coinaddr,strlen(ap->coinaddr),ap); return(ap); } diff --git a/iguana/exchanges/LP_socket.c b/iguana/exchanges/LP_socket.c index afca7e887..2c3eb1e6e 100644 --- a/iguana/exchanges/LP_socket.c +++ b/iguana/exchanges/LP_socket.c @@ -350,7 +350,10 @@ int32_t electrum_process_array(struct iguana_info *coin,struct electrum_info *ep } } if ( value != 0 || tx->height > 0 ) + { + printf("from electrum_process_array\n"); flag += LP_address_utxoadd(coin,coinaddr,txid,v,value,tx->height,-1); + } //printf("v.%d numvouts.%d %.8f (%s)\n",v,tx->numvouts,dstr(tx->outpoints[jint(item,"tx_pos")].value),jprint(item,0)); } //else printf("cant find tx\n"); } @@ -481,6 +484,7 @@ cJSON *electrum_address_gethistory(char *symbol,struct electrum_info *ep,cJSON * if ( tx->height > 0 && tx->height != height ) printf("update %s height.%d <- %d\n",bits256_str(str,txid),tx->height,height); tx->height = height; + printf("from history\n"); LP_address_utxoadd(coin,addr,txid,0,0,height,-1); } } diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index b144a95c4..4eb2a4f65 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -178,7 +178,7 @@ int32_t LP_address_utxo_ptrs(int32_t iambob,struct LP_address_utxo **utxos,int32 struct LP_address_utxo *LP_address_utxofind(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; - //printf("%s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); + printf("LP_address_utxofind %s add addr.%s ht.%d\n",coin->symbol,coinaddr,height); if ( (ap= _LP_address(coin,coinaddr)) != 0 ) { DL_FOREACH_SAFE(ap->utxos,up,tmp) @@ -227,7 +227,7 @@ int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid, { if ( (txobj= LP_gettxout(coin->symbol,coinaddr,txid,vout)) == 0 ) { - printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); + //printf("prevent utxoadd since gettxout %s %s %s/v%d missing\n",coin->symbol,coinaddr,bits256_str(str,txid),vout); return(0); } else free_json(txobj); } @@ -484,6 +484,7 @@ int32_t LP_unspents_array(struct iguana_info *coin,char *coinaddr,cJSON *array) } if ( errs == 0 ) { + printf("from LP_unspents_array\n"); LP_address_utxoadd(coin,coinaddr,txid,v,val,height,-1); count++; } @@ -631,6 +632,8 @@ uint64_t LP_txinterestvalue(uint64_t *interestp,char *destaddr,struct iguana_inf cJSON *LP_transactioninit(struct iguana_info *coin,bits256 txid,int32_t iter,cJSON *txobj) { struct LP_transaction *tx; int32_t i,height,numvouts,numvins,spentvout; cJSON *vins,*vouts,*vout,*vin; bits256 spenttxid; char str[65]; + if ( coin->inactive != 0 ) + return(0); if ( txobj != 0 || (txobj= LP_gettx(coin->symbol,txid)) != 0 ) { if ( coin->electrum == 0 )