Browse Source

Test

etomic
jl777 7 years ago
parent
commit
8b4cc47bdf
  1. 2
      iguana/exchanges/LP_prices.c
  2. 4
      iguana/exchanges/LP_signatures.c

2
iguana/exchanges/LP_prices.c

@ -1164,7 +1164,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price,char *u
}
if ( (pubp= LP_pubkeyadd(pubkey)) != 0 )
{
if ( (LP_rand() % 1000) == 0 )
//if ( (LP_rand() % 1000) == 0 )
printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price);
pubp->timestamp = (uint32_t)time(NULL);
LP_pubkey_update(pubp,basepp->ind,relpp->ind,price,balance,utxocoin,numrelutxos,minutxo,maxutxo);

4
iguana/exchanges/LP_signatures.c

@ -489,7 +489,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re
char *LP_postprice_recv(cJSON *argjson)
{
bits256 pubkey; double price; char *base,*rel;
printf("PRICE POSTED.(%s)\n",jprint(argjson,0));
//printf("PRICE POSTED.(%s)\n",jprint(argjson,0));
if ( (base= jstr(argjson,"base")) != 0 && (rel= jstr(argjson,"rel")) != 0 && (price= jdouble(argjson,"price")) > SMALLVAL )
{
pubkey = jbits256(argjson,"pubkey");
@ -497,7 +497,7 @@ char *LP_postprice_recv(cJSON *argjson)
{
if ( LP_price_sigcheck(juint(argjson,"timestamp"),jstr(argjson,"sig"),jstr(argjson,"pubsecp"),pubkey,base,rel,j64bits(argjson,"price64")) == 0 )
{
printf("call pricefeed update\n");
//printf("call pricefeed update\n");
LP_pricefeedupdate(pubkey,base,rel,price,jstr(argjson,"utxocoin"),jint(argjson,"n"),jdouble(argjson,"bal")*SATOSHIDEN,jdouble(argjson,"min")*SATOSHIDEN,jdouble(argjson,"max")*SATOSHIDEN);
return(clonestr("{\"result\":\"success\"}"));
}

Loading…
Cancel
Save