Browse Source

Test

etomic
jl777 8 years ago
parent
commit
fadd624ecc
  1. 3
      iguana/exchanges/LP_nativeDEX.c
  2. 6
      iguana/exchanges/LP_prices.c
  3. 2
      iguana/exchanges/LP_utxos.c

3
iguana/exchanges/LP_nativeDEX.c

@ -19,10 +19,11 @@
//
// new features:
// stats
// multidimensional portfolio
// multidimensional portfolio, percentage among active vs all
// autoutxo
// bugs:
// getutxos lastn field
// false detection of bobreclaim
// unduplicated bugs:

6
iguana/exchanges/LP_prices.c

@ -792,14 +792,14 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price)
{
struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512]; FILE *fp;
//printf("check PRICEFEED UPDATE.(%s/%s) %.8f %s\n",base,rel,price,bits256_str(str,pubkey));
if ( price > SMALLVAL && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 )
if ( price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 )
{
if ( (fp= basepp->fps[relpp->ind]) == 0 )
{
LP_pricefname(fname,base,rel);
fp = basepp->fps[relpp->ind] = OS_appendfile(fname);
}
if ( fp != 0 && price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN )
if ( fp != 0 )
{
now = (uint32_t)time(NULL);
price64 = price * SATOSHIDEN;
@ -812,7 +812,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price)
sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,rel,base);
fp = relpp->fps[basepp->ind] = OS_appendfile(fname);
}
if ( fp != 0 && price > SMALLVAL && isnan(price) == 0 && price < SATOSHIDEN )
if ( fp != 0 )
{
now = (uint32_t)time(NULL);
price64 = (1. / price) * SATOSHIDEN;

2
iguana/exchanges/LP_utxos.c

@ -359,7 +359,7 @@ char *LP_utxos(int32_t iambob,struct LP_peerinfo *mypeer,char *symbol,int32_t la
if ( lastn >= n )
firsti = -1;
else firsti = (lastn - n);
//printf("LP_utxos iambob.%d symbol.%s firsti.%d lastn.%d\n",iambob,symbol==0?"":symbol,firsti,lastn);
printf("LP_utxos iambob.%d symbol.%s firsti.%d lastn.%d\n",iambob,symbol==0?"":symbol,firsti,lastn);
HASH_ITER(hh,LP_utxoinfos[iambob],utxo,tmp)
{
//char str[65]; printf("check %s.%s\n",utxo->coin,bits256_str(str,utxo->payment.txid));

Loading…
Cancel
Save