From 0c9a957a043c13308c0ed759dffa1838064c6d1b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 28 Jan 2018 17:07:35 +0400 Subject: [PATCH] Revert --- iguana/exchanges/LP_commands.c | 2 +- iguana/exchanges/LP_instantdex.c | 2 +- iguana/exchanges/LP_ordermatch.c | 6 +++--- iguana/exchanges/LP_portfolio.c | 2 +- iguana/exchanges/LP_prices.c | 2 +- iguana/exchanges/LP_remember.c | 2 +- iguana/exchanges/LP_signatures.c | 4 ++-- iguana/exchanges/LP_stats.c | 4 ++-- iguana/exchanges/LP_tradebots.c | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 72a71e648..94186c659 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -681,7 +681,7 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ jaddnum(retjson,"timestamp",time(NULL)); jaddnum(retjson,"bid",bid); jaddnum(retjson,"ask",ask); - jaddnum(retjson,"price",dstr(SATOSHIDEN * price)); + jaddnum(retjson,"price",price); return(jprint(retjson,1)); } /*else if ( strcmp(method,"getpeers") == 0 ) diff --git a/iguana/exchanges/LP_instantdex.c b/iguana/exchanges/LP_instantdex.c index f06cd9cbc..f0b6aa50a 100644 --- a/iguana/exchanges/LP_instantdex.c +++ b/iguana/exchanges/LP_instantdex.c @@ -567,7 +567,7 @@ cJSON *LP_swapstats_item(struct LP_swapstats *sp,int32_t iambob) jaddnum(item,"satoshis",sp->Q.satoshis); jaddstr(item,"rel",sp->Q.destcoin); jaddnum(item,"destsatoshis",sp->Q.destsatoshis); - jaddnum(item,"price",dstr(SATOSHIDEN * (sp->Q.destsatoshis/((double)sp->Q.satoshis+1)))); + jaddnum(item,"price",sp->Q.destsatoshis/((double)sp->Q.satoshis+1)); if ( LP_swap_finished(sp,1) == 0 ) { jaddnum(item,"finished",sp->finished); diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 615cb1057..bb22c383d 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -181,7 +181,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str return(-33); } if ( qp->satoshis != 0 ) - qprice = ((double)qp->destsatoshis / (qp->satoshis-qp->txfee)) + 0.000000049; + qprice = ((double)qp->destsatoshis / (qp->satoshis-qp->txfee)); LP_txfees(&txfee,&desttxfee,qp->srccoin,qp->destcoin); if ( txfee < qp->txfee ) txfee = qp->txfee; @@ -846,7 +846,7 @@ struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,stru LP_abutxo_set(autxo,butxo,qp); if ( bits256_nonz(qp->srchash) == 0 || bits256_cmp(qp->srchash,G.LP_mypub25519) == 0 ) { - qprice = (double)qp->destsatoshis / (qp->satoshis - qp->txfee) + 0.000000049; + qprice = (double)qp->destsatoshis / (qp->satoshis - qp->txfee); strcpy(qp->gui,G.gui); strcpy(qp->coinaddr,coin->smartaddr); strcpy(butxo->coinaddr,coin->smartaddr); @@ -980,7 +980,7 @@ int32_t LP_trades_bestpricecheck(void *ctx,struct LP_trade *tp) //printf("check bestprice %.8f vs new price %.8f\n",tp->bestprice,(double)Q.destsatoshis/Q.satoshis); if ( Q.satoshis != 0 && (pubp= LP_pubkeyadd(Q.srchash)) != 0 )//(qprice= LP_trades_alicevalidate(ctx,&Q)) > 0. ) { - qprice = (double)Q.destsatoshis / (Q.satoshis - Q.txfee) + 0.000000049; + qprice = (double)Q.destsatoshis / (Q.satoshis - Q.txfee); LP_aliceid(Q.tradeid,tp->aliceid,"reserved",0,0); if ( (retstr= LP_quotereceived(&Q)) != 0 ) free(retstr); diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index 49db78608..ead40b27c 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -71,7 +71,7 @@ cJSON *LP_portfolio_entry(struct iguana_info *coin) jaddstr(item,"coin",coin->symbol); jaddstr(item,"address",coin->smartaddr); jaddnum(item,"amount",dstr(coin->maxamount)); - jaddnum(item,"price",dstr(SATOSHIDEN * coin->price_kmd)); + jaddnum(item,"price",coin->price_kmd); jaddnum(item,"kmd_equiv",dstr(coin->kmd_equiv)); jaddnum(item,"perc",coin->perc); jaddnum(item,"goal",coin->goal); diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index f67bffd8c..cee20a5d2 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -741,7 +741,7 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) { jaddstr(item,"coin",symbol); jaddstr(item,"address",op->coinaddr); - jaddnum(item,"price",dstr(SATOSHIDEN * op->price)); + jaddnum(item,"price",op->price); jaddnum(item,"numutxos",op->numutxos); jaddnum(item,"avevolume",dstr(op->avesatoshis)*0.8); jaddnum(item,"maxvolume",dstr(op->maxsatoshis)*0.8); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index b88128dbb..8c50de4fe 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -1399,7 +1399,7 @@ char *LP_recent_swaps(int32_t limit) subitem = cJSON_CreateObject(); jaddnum(subitem,base,srcamount); jaddnum(subitem,rel,destamount); - jaddnum(subitem,"price",dstr(SATOSHIDEN * -destamount/srcamount)); + jaddnum(subitem,"price",-destamount/srcamount); jaddi(item,subitem); } } else printf("base.%p rel.%p statusstr.%p baseind.%d relind.%d\n",base,rel,statusstr,baseind,relind); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 1daae27b6..31870fad2 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -92,7 +92,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) if ( qp->satoshis != 0 ) { price = (double)qp->destsatoshis / (qp->satoshis - qp->txfee); - jaddnum(retjson,"price",dstr(SATOSHIDEN * price)); + jaddnum(retjson,"price",price); } } if ( qp->R.requestid != 0 ) @@ -405,7 +405,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re jaddstr(reqjson,"base",base); jaddstr(reqjson,"rel",rel); price64 = price * SATOSHIDEN + 0.0000000049; - jaddnum(reqjson,"price",dstr(price64)); + jaddnum(reqjson,"price",price); jadd64bits(reqjson,"price64",price64); jaddstr(reqjson,"method","postprice"); timestamp = (uint32_t)time(NULL); diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 54bd0c918..1bce64fde 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -556,7 +556,7 @@ cJSON *LP_swapstats_json(struct LP_swapstats *sp) jaddbits256(item,"dest",sp->Q.desthash); jaddstr(item,"rel",sp->Q.destcoin); jaddnum(item,"relvol",dstr(sp->Q.destsatoshis)); - jaddnum(item,"price",dstr(SATOSHIDEN * sp->qprice)); + jaddnum(item,"price",sp->qprice); jaddnum(item,"requestid",sp->Q.R.requestid); jaddnum(item,"quoteid",sp->Q.R.quoteid); jaddnum(item,"finished",sp->finished); @@ -823,7 +823,7 @@ char *LP_ticker(char *refbase,char *refrel) jaddnum(retitem,"timestamp",juint(item,"timestamp")); jaddnum(retitem,base,basevol); jaddnum(retitem,rel,relvol); - jaddnum(retitem,"price",dstr(SATOSHIDEN * (relvol/basevol))); + jaddnum(retitem,"price",relvol/basevol); } jaddi(retjson,retitem); } diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index 6e1bb749a..39526c2be 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -142,13 +142,13 @@ cJSON *LP_tradebot_tradejson(struct LP_tradebot_trade *tp,int32_t dispflag) { if ( dispflag > 0 ) { - jaddnum(item,"price",dstr(SATOSHIDEN * (tp->relvol/tp->basevol))); + jaddnum(item,"price",tp->relvol/tp->basevol); jaddnum(item,"volume",tp->relvol); } else { price = LP_pricevol_invert(&basevol,tp->relvol / tp->basevol,tp->relvol); - jaddnum(item,"price",dstr(SATOSHIDEN * price)); + jaddnum(item,"price",price); jaddnum(item,"volume",basevol); } }