Browse Source

Test

etomic
jl777 8 years ago
parent
commit
9389185037
  1. 2
      iguana/exchanges/LP_nativeDEX.c
  2. 6
      iguana/exchanges/LP_ordermatch.c
  3. 4
      iguana/exchanges/LP_portfolio.c
  4. 2
      iguana/exchanges/LP_prices.c

2
iguana/exchanges/LP_nativeDEX.c

@ -184,7 +184,7 @@ char *LP_process_message(void *ctx,char *typestr,char *myipaddr,int32_t pubsock,
if ( duplicate != 0 )
dup++;
else uniq++;
if ( (rand() % 100) == 0 )
if ( (rand() % 1000) == 0 )
printf("%s dup.%d (%u / %u) %.1f%% encrypted.%d recv.%u [%02x %02x] vs %02x %02x U.%d\n",typestr,duplicate,dup,dup+uniq,(double)100*dup/(dup+uniq),encrypted,crc32,ptr[0],ptr[1],crc32&0xff,(crc32>>8)&0xff,LP_mypeer != 0 ? LP_mypeer->numutxos : -1);
if ( duplicate == 0 )
{

6
iguana/exchanges/LP_ordermatch.c

@ -471,7 +471,7 @@ char *LP_connectedalice(cJSON *argjson) // alice
}
if ( (coin= LP_coinfind(Q.destcoin)) == 0 )
{
LP_pendingswaps++;
LP_pendingswaps--;
return(clonestr("{\"error\":\"cant get alicecoin\"}"));
}
Q.privkey = LP_privkey(Q.destaddr,coin->taddr);
@ -502,13 +502,12 @@ char *LP_connectedalice(cJSON *argjson) // alice
printf("connected result.(%s)\n",jprint(retjson,0));
if ( jobj(retjson,"error") != 0 )
LP_availableset(autxo);
else LP_pendingswaps--;
else LP_pendingswaps++;
return(jprint(retjson,1));
}
else
{
LP_availableset(autxo);
LP_pendingswaps--;
printf("no privkey found\n");
return(clonestr("{\"error\",\"no privkey\"}"));
}
@ -753,7 +752,6 @@ char *LP_trade(void *ctx,char *myipaddr,int32_t mypubsock,struct LP_quoteinfo *q
}
if ( aliceutxo->S.swap == 0 )
LP_availableset(aliceutxo);
else LP_pendingswaps++;
return(jprint(bestitem,0));
}

4
iguana/exchanges/LP_portfolio.c

@ -343,7 +343,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
char *retstr; cJSON *retjson,*bid,*ask; uint64_t bidsatoshis,asksatoshis; int32_t i; double nxtkmd,price; struct LP_priceinfo *kmdpp,*fiatpp,*nxtpp;
if ( (retstr= issue_curlt("https://bittrex.com/api/v1.1/public/getmarketsummaries",LP_HTTP_TIMEOUT*10)) == 0 )
{
printf("error getting marketsummaries\n");
printf("trex error getting marketsummaries\n");
sleep(60);
return;
}
@ -351,7 +351,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp)
free(retstr);
if ( (retstr= issue_curlt("https://www.cryptopia.co.nz/api/GetMarkets",LP_HTTP_TIMEOUT*10)) == 0 )
{
printf("error getting marketsummaries\n");
printf("cryptopia error getting marketsummaries\n");
sleep(60);
return;
}

2
iguana/exchanges/LP_prices.c

@ -833,7 +833,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price)
}
if ( (pubp= LP_pubkeyadd(pubkey)) != 0 )
{
if ( (rand() % 10) == 0 && fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL )
if ( (rand() % 100) == 0 && fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL )
printf("PRICEFEED UPDATE.(%-6s/%6s) %12.8f %s %12.8f\n",base,rel,price,bits256_str(str,pubkey),1./price);
{
pubp->matrix[basepp->ind][relpp->ind] = price;

Loading…
Cancel
Save