From bdc01eb1336c6b3ad88ebf2f9f0335bbef6b161a Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 9 Nov 2017 15:41:49 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 2 -- iguana/exchanges/LP_portfolio.c | 9 +++++++-- iguana/exchanges/install | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cc83f34a5..a76bd882c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -21,9 +21,7 @@ // detecting new deposits in inventory // BTC swaps // bot progress -// will stale peers ever die? <- after a day it should // swap started event for bot -// withdraw too big // bot status 1600% ? // BCH signing // dPoW security -> 4: KMD notarized, 5: BTC notarized, after next notary elections diff --git a/iguana/exchanges/LP_portfolio.c b/iguana/exchanges/LP_portfolio.c index c36c64d67..87b50f474 100644 --- a/iguana/exchanges/LP_portfolio.c +++ b/iguana/exchanges/LP_portfolio.c @@ -222,7 +222,7 @@ struct LP_autoprice_ref int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) { //curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"MNZ\",\"rel\":\"KMD\",\"offset\":0.1,\"refbase\":\"KMD\",\refrel\":\"BTC\",\"factor\":15000,\"margin\":0.01}" - struct LP_priceinfo *basepp,*relpp; int32_t i; char *refbase,*refrel; double minprice,margin,offset,factor,fixedprice; + struct LP_priceinfo *basepp,*relpp; int32_t i; char *refbase="",*refrel=""; double minprice,margin,offset,factor,fixedprice; //printf("autoprice.(%s %s) %s\n",base,rel,jprint(argjson,0)); if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) { @@ -238,8 +238,13 @@ int32_t LP_autoprice(char *base,char *rel,cJSON *argjson) basepp->margins[relpp->ind] = margin; basepp->offsets[relpp->ind] = offset; basepp->factors[relpp->ind] = factor; - if ( (refbase= jstr(argjson,"refbase")) != 0 && (refrel= jstr(argjson,"refrel")) != 0 ) + if ( fixedprice > SMALLVAL || ((refbase= jstr(argjson,"refbase")) != 0 && (refrel= jstr(argjson,"refrel")) != 0) ) { + if ( fixedprice > SMALLVAL ) + { + refbase = base; + refrel = rel; + } for (i=0; i