Browse Source

Test

etomic
jl777 7 years ago
parent
commit
54ebf26d6d
  1. 1
      iguana/exchanges/LP_instantdex.c
  2. 7
      iguana/exchanges/LP_portfolio.c

1
iguana/exchanges/LP_instantdex.c

@ -509,6 +509,7 @@ int64_t LP_instantdex_proofcheck(char *coinaddr,cJSON *proof,int32_t num)
{ {
bitcoin_addr2rmd160(0,&addrtype,rmd160,coinaddr); bitcoin_addr2rmd160(0,&addrtype,rmd160,coinaddr);
bitcoin_address(othersmartaddr,0,60,rmd160,20); bitcoin_address(othersmartaddr,0,60,rmd160,20);
printf("proofcheck addrtype.%d (%s) -> %s\n",addrtype,coinaddr,othersmartaddr);
if ((ap= LP_address(coin,othersmartaddr)) != 0 ) if ((ap= LP_address(coin,othersmartaddr)) != 0 )
{ {
ap->instantdex_credits = 0; ap->instantdex_credits = 0;

7
iguana/exchanges/LP_portfolio.c

@ -473,7 +473,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
int32_t LP_autoprice(void *ctx,char *base,char *rel,cJSON *argjson) int32_t LP_autoprice(void *ctx,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}" //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,isfundvalue,retval = -1; char *refbase="",*refrel=""; double minprice,margin,offset,factor,fixedprice; struct LP_priceinfo *basepp,*relpp; int32_t i,retval = -1; char *fundvalue_bid,*fundvalue_ask,*refbase="",*refrel=""; double minprice,margin,offset,factor,fixedprice;
//printf("autoprice.(%s %s) %s\n",base,rel,jprint(argjson,0)); //printf("autoprice.(%s %s) %s\n",base,rel,jprint(argjson,0));
if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 ) if ( (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 )
{ {
@ -491,8 +491,9 @@ int32_t LP_autoprice(void *ctx,char *base,char *rel,cJSON *argjson)
basepp->factors[relpp->ind] = factor; basepp->factors[relpp->ind] = factor;
refbase = jstr(argjson,"refbase"); refbase = jstr(argjson,"refbase");
refrel = jstr(argjson,"refrel"); refrel = jstr(argjson,"refrel");
isfundvalue = jint(argjson,"fundvalue"); fundvalue_bid = jstr(argjson,"fundvalue_bid");
if ( isfundvalue != 0 || fixedprice > SMALLVAL || (refbase != 0 && refrel != 0) ) fundvalue_ask = jstr(argjson,"fundvalue_ask");
if ( fundvalue_bid != 0 || fundvalue_ask != 0 || fixedprice > SMALLVAL || (refbase != 0 && refrel != 0) )
{ {
if ( fixedprice > SMALLVAL ) if ( fixedprice > SMALLVAL )
{ {

Loading…
Cancel
Save