From 3a8910fa8fabe0eb1f0b0cdb5748d9e35df7105a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 3 Jun 2017 11:05:41 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 3 ++- iguana/exchanges/LP_prices.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 95b94fdd2..79be79a61 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -36,7 +36,7 @@ portable_mutex_t LP_peermutex,LP_utxomutex,LP_commandmutex,LP_cachemutex; int32_t LP_mypubsock = -1; int32_t Client_connections; int32_t USERPASS_COUNTER,IAMCLIENT = 0; - +double LP_profitratio = 1.; // stubs int32_t basilisk_istrustedbob(struct basilisk_swap *swap) @@ -236,6 +236,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,double profit { char *myipaddr=0; long filesize,n; int32_t timeout,maxsize,pullsock=-1,pubsock=-1; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128]; IAMCLIENT = amclient; + LP_profitratio += profitmargin; OS_randombytes((void *)&n,sizeof(n)); srand((int32_t)n); if ( userhome != 0 && userhome[0] != 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index d7b29804b..11fe76813 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -144,8 +144,8 @@ int32_t LP_mypriceset(char *base,char *rel,double price) struct LP_priceinfo *basepp,*relpp; if ( price != 0. && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { - basepp->myprices[relpp->ind] = price; // ask - relpp->myprices[basepp->ind] = 1. / price; // bid + basepp->myprices[relpp->ind] = price * LP_profitratio; // ask + relpp->myprices[basepp->ind] = (1. / price) * LP_profitratio; // bid return(0); } else return(-1); }