From 0f2b98a12bfa7f888c4c2b05594b132fcafca802 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 4 Feb 2018 17:54:04 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_ordermatch.c | 4 +++- iguana/exchanges/LP_utxo.c | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 50874b800..1bb578a21 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -871,7 +871,9 @@ struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,stru printf("request from blacklisted %s, ignore\n",bits256_str(str,qp->desthash)); return(0); } + printf("LP_address_utxo_reset\n"); LP_address_utxo_reset(coin); + printf("done LP_address_utxo_reset\n"); if ( (butxo= LP_address_myutxopair(butxo,1,utxos,max,LP_coinfind(qp->srccoin),qp->coinaddr,qp->txfee,dstr(qp->destsatoshis),price,qp->desttxfee)) != 0 ) { strcpy(qp->gui,G.gui); @@ -1011,7 +1013,7 @@ void LP_tradesloop(void *ctx) now = (uint32_t)time(NULL); Q = qtp->Q; funcid = qtp->funcid; -//printf("dequeue %p funcid.%d aliceid.%llu iambob.%d\n",qtp,funcid,(long long)qtp->aliceid,qtp->iambob); +printf("dequeue %p funcid.%d aliceid.%llu iambob.%d\n",qtp,funcid,(long long)qtp->aliceid,qtp->iambob); portable_mutex_lock(&LP_tradesmutex); DL_DELETE(LP_tradesQ,qtp); HASH_FIND(hh,LP_trades,&qtp->aliceid,sizeof(qtp->aliceid),tp); diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index 1bf47ebc2..4a1ef1034 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -447,9 +447,10 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t i,n,m,vout,height; cJSON *array,*item,*txobj; bits256 zero; int64_t value; bits256 txid; uint32_t now; LP_address(coin,coin->smartaddr); - //printf("call listunspent issue %s (%s)\n",coin->symbol,coin->smartaddr); + printf("call listunspent issue %s (%s)\n",coin->symbol,coin->smartaddr); memset(zero.bytes,0,sizeof(zero)); LP_listunspent_issue(coin->symbol,coin->smartaddr,2,zero,zero); + printf("back from listunspent\n"); if ( (ap= LP_addressfind(coin,coin->smartaddr)) == 0 ) { printf("LP_address_utxo_reset: cant find address data\n"); @@ -457,6 +458,7 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) } if ( (array= LP_listunspent(coin->symbol,coin->smartaddr,zero,zero)) != 0 ) { + printf("clear ap->utxos\n"); DL_FOREACH_SAFE(ap->utxos,up,tmp) { portable_mutex_lock(&coin->addrmutex); @@ -467,6 +469,7 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) DL_APPEND(LP_garbage_collector2,up); portable_mutex_unlock(&LP_gcmutex); } + printf("done clearing ap->utxos\n"); now = (uint32_t)time(NULL); if ( (n= cJSON_GetArraySize(array)) > 0 ) { @@ -487,10 +490,10 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) else { m++; - //printf("%.8f ",dstr(value)); + printf("%.8f ",dstr(value)); } } - //printf("added %d from listunspents\n",m); + printf("added %d from listunspents\n",m); } free_json(array); }