Browse Source

Test

etomic
jl777 7 years ago
parent
commit
fb12f4dbea
  1. 3
      iguana/exchanges/LP_include.h
  2. 8
      iguana/exchanges/LP_prices.c

3
iguana/exchanges/LP_include.h

@ -320,7 +320,8 @@ struct LP_pubkeyinfo
UT_hash_handle hh;
bits256 pubkey;
float matrix[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS];
uint32_t timestamps[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS],timestamp,numerrors;
//uint32_t timestamps[LP_MAXPRICEINFOS][LP_MAXPRICEINFOS];
uint32_t timestamp,numerrors;
int32_t istrusted;
uint8_t rmd160[20],sig[65],pubsecp[33],siglen;
};

8
iguana/exchanges/LP_prices.c

@ -345,7 +345,7 @@ void LP_prices_parse(struct LP_peerinfo *peer,cJSON *obj)
{
//char str[65]; printf("gotprice %s %s/%s (%d/%d) %.8f\n",bits256_str(str,pubkey),base,rel,basepp->ind,relid,askprice);
pubp->matrix[basepp->ind][relid] = askprice;
pubp->timestamps[basepp->ind][relid] = timestamp;
//pubp->timestamps[basepp->ind][relid] = timestamp;
if ( (relpp= LP_priceinfofind(rel)) != 0 )
{
dxblend(&basepp->relvals[relpp->ind],askprice,0.9);
@ -497,7 +497,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price)
{
pubp->timestamp = (uint32_t)time(NULL);
pubp->matrix[basepp->ind][relpp->ind] = price;
pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp;
//pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp;
//pubp->matrix[relpp->ind][basepp->ind] = (1. / price);
}
return(0);
@ -741,7 +741,7 @@ int32_t LP_orderbook_utxoentries(uint32_t now,int32_t polarity,char *base,char *
bitcoin_address(coinaddr,basecoin->taddr,basecoin->pubtype,pubp->rmd160,sizeof(pubp->rmd160));
minsatoshis = maxsatoshis = n = 0;
ap = 0;
if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL && pubp->timestamps[baseid][relid] >= oldest )
if ( (price= pubp->matrix[baseid][relid]) > SMALLVAL )//&& pubp->timestamps[baseid][relid] >= oldest )
{
balance = 0;
if ( (ap= LP_addressfind(basecoin,coinaddr)) != 0 )
@ -1070,7 +1070,7 @@ void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price)
if ( fabs(pubp->matrix[basepp->ind][relpp->ind] - price) > SMALLVAL )
{
pubp->matrix[basepp->ind][relpp->ind] = price;
pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp;
//pubp->timestamps[basepp->ind][relpp->ind] = pubp->timestamp;
dxblend(&basepp->relvals[relpp->ind],price,0.9);
dxblend(&relpp->relvals[basepp->ind],1. / price,0.9);
}

Loading…
Cancel
Save