From 46e91f04f141648dd144938c7797e1563fe29934 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 1 Jun 2017 08:43:04 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_nativeDEX.c | 5 +++-- iguana/exchanges/LP_rpc.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 69b7452d5..4c69954dd 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -284,6 +284,7 @@ int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char * { memset(qp,0,sizeof(*qp)); qp->timestamp = (uint32_t)time(NULL); + safecopy(qp->destcoin,destcoin,sizeof(qp->destcoin)); if ( (qp->txfee= LP_getestimatedrate(utxo->coin)*LP_AVETXSIZE) < 10000 ) qp->txfee = 10000; if ( qp->txfee >= utxo->satoshis || qp->txfee >= utxo->satoshis2 ) @@ -302,7 +303,6 @@ int32_t LP_quoteinfoinit(struct LP_quoteinfo *qp,struct LP_utxoinfo *utxo,char * qp->destsatoshis -= qp->desttxfee; safecopy(qp->srccoin,utxo->coin,sizeof(qp->srccoin)); safecopy(qp->coinaddr,utxo->coinaddr,sizeof(qp->coinaddr)); - safecopy(qp->destcoin,destcoin,sizeof(qp->destcoin)); qp->srchash = LP_pubkey(LP_privkey(utxo->coinaddr)); return(0); } diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index c2305dc23..01b57a821 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -113,7 +113,7 @@ double LP_pricecache(struct LP_quoteinfo *qp,char *base,char *rel,bits256 txid,i { if ( qp != 0 ) (*qp) = ptr->Q; - //printf("found %s/%s %.8f\n",base,rel,ptr->price); + printf("found %s/%s %.8f\n",base,rel,ptr->price); return(ptr->price); } else if ( qp != 0 ) @@ -140,6 +140,7 @@ struct LP_cacheinfo *LP_cacheadd(char *base,char *rel,bits256 txid,int32_t vout, ptr->price = price; ptr->Q = *qp; ptr->timestamp = (uint32_t)time(NULL); + printf("cacheadd %.8f\n",price); return(ptr); } @@ -926,7 +927,7 @@ void LP_mainloop(struct LP_peerinfo *mypeer,uint16_t mypubport,int32_t pubsock,i LP_privkey_updates(mypeer,pubsock,passphrase,amclient); HASH_ITER(hh,LP_peerinfos,peer,tmp) { - if ( peer->numpeers != mypeer->numpeers || (rand() % 1000) == 0 ) + if ( peer->numpeers != mypeer->numpeers || (rand() % 10000) == 0 ) { if ( peer->numpeers != mypeer->numpeers ) printf("%s num.%d vs %d\n",peer->ipaddr,peer->numpeers,mypeer->numpeers); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b30a303a4..d6a3dfeab 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -155,7 +155,7 @@ double LP_getestimatedrate(char *symbol) if ( retstr[0] != '-' ) { rate = atof(retstr) / 1024.; - printf("estimated rate.%s %s -> %.8f\n",coin->symbol,retstr,rate); + printf("estimated rate.(%s) %s -> %.8f\n",symbol,retstr,rate); } free(retstr); }