jl777 7 years ago
parent
commit
98d04bf25a
  1. 2
      crypto777/OS_portable.h
  2. 6
      iguana/exchanges/LP_ordermatch.c
  3. 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)((uint64_t)(x)) / SATOSHIDEN + 0.0000000049)
#define dstr(x) ((double)((uint64_t)(x)) / SATOSHIDEN)
#define SMALLVAL 0.000000000000001

6
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));
qprice = ((double)qp->destsatoshis / (qp->satoshis-qp->txfee)) + 0.000000049;
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);
qprice = (double)qp->destsatoshis / (qp->satoshis - qp->txfee) + 0.000000049;
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);
qprice = (double)Q.destsatoshis / (Q.satoshis - Q.txfee) + 0.000000049;
LP_aliceid(Q.tradeid,tp->aliceid,"reserved",0,0);
if ( (retstr= LP_quotereceived(&Q)) != 0 )
free(retstr);

2
includes/cJSON.h

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

Loading…
Cancel
Save