jl777 7 years ago
parent
commit
6a70aeb6c0
  1. 2
      crypto777/OS_portable.h
  2. 2
      iguana/exchanges/LP_commands.c
  3. 2
      iguana/exchanges/LP_instantdex.c
  4. 2
      iguana/exchanges/LP_portfolio.c
  5. 2
      iguana/exchanges/LP_prices.c
  6. 2
      iguana/exchanges/LP_remember.c
  7. 4
      iguana/exchanges/LP_signatures.c
  8. 4
      iguana/exchanges/LP_stats.c
  9. 4
      iguana/exchanges/LP_tradebots.c
  10. 2
      includes/cJSON.h

2
crypto777/OS_portable.h

@ -115,7 +115,7 @@ int32_t hseek(HUFF *hp,int32_t offset,int32_t mode);
#define GENESIS_SECRET "It was a bright cold day in April, and the clocks were striking thirteen."
#define SATOSHIDEN ((uint64_t)100000000L)
#define dstr(x) ((double)(x) / SATOSHIDEN)
#define dstr(x) ((double)((uint64_t)(x)) / SATOSHIDEN)
#define SMALLVAL 0.000000000000001

2
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",price);
jaddnum(retjson,"price",dstr(SATOSHIDEN * price));
return(jprint(retjson,1));
}
/*else if ( strcmp(method,"getpeers") == 0 )

2
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",sp->Q.destsatoshis/((double)sp->Q.satoshis+1));
jaddnum(item,"price",dstr(SATOSHIDEN * (sp->Q.destsatoshis/((double)sp->Q.satoshis+1))));
if ( LP_swap_finished(sp,1) == 0 )
{
jaddnum(item,"finished",sp->finished);

2
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",coin->price_kmd);
jaddnum(item,"price",dstr(SATOSHIDEN * coin->price_kmd));
jaddnum(item,"kmd_equiv",dstr(coin->kmd_equiv));
jaddnum(item,"perc",coin->perc);
jaddnum(item,"goal",coin->goal);

2
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",op->price);
jaddnum(item,"price",dstr(SATOSHIDEN * op->price));
jaddnum(item,"numutxos",op->numutxos);
jaddnum(item,"avevolume",dstr(op->avesatoshis)*0.8);
jaddnum(item,"maxvolume",dstr(op->maxsatoshis)*0.8);

2
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",-destamount/srcamount);
jaddnum(subitem,"price",dstr(SATOSHIDEN * -destamount/srcamount));
jaddi(item,subitem);
}
} else printf("base.%p rel.%p statusstr.%p baseind.%d relind.%d\n",base,rel,statusstr,baseind,relind);

4
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",price);
jaddnum(retjson,"price",dstr(SATOSHIDEN * 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",price);
jaddnum(reqjson,"price",dstr(price64));
jadd64bits(reqjson,"price64",price64);
jaddstr(reqjson,"method","postprice");
timestamp = (uint32_t)time(NULL);

4
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",sp->qprice);
jaddnum(item,"price",dstr(SATOSHIDEN * 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",relvol/basevol);
jaddnum(retitem,"price",dstr(SATOSHIDEN * (relvol/basevol)));
}
jaddi(retjson,retitem);
}

4
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",tp->relvol/tp->basevol);
jaddnum(item,"price",dstr(SATOSHIDEN * (tp->relvol/tp->basevol)));
jaddnum(item,"volume",tp->relvol);
}
else
{
price = LP_pricevol_invert(&basevol,tp->relvol / tp->basevol,tp->relvol);
jaddnum(item,"price",price);
jaddnum(item,"price",dstr(SATOSHIDEN * price));
jaddnum(item,"volume",basevol);
}
}

2
includes/cJSON.h

@ -31,7 +31,7 @@
#include "../crypto777/OS_portable.h"
#define SATOSHIDEN ((uint64_t)100000000L)
#define dstr(x) ((double)(x) / SATOSHIDEN)
#define dstr(x) ((double)((uint64_t)(x)) / SATOSHIDEN)
#define MAX_JSON_FIELD 4096 // on the big side
#ifdef __cplusplus

Loading…
Cancel
Save