Browse Source

Test

etomic
jl777 8 years ago
parent
commit
82d40b128d
  1. 16
      iguana/exchanges/LP_prices.c
  2. 1
      iguana/exchanges/mm.c

16
iguana/exchanges/LP_prices.c

@ -642,7 +642,21 @@ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveas
void LP_pricefeedupdate(bits256 pubkey,char *base,char *rel,double price)
{
struct LP_priceinfo *basepp,*relpp; struct LP_pubkeyinfo *pubp; char str[65];
static FILE *fp;
struct LP_priceinfo *basepp,*relpp; uint32_t now; uint64_t price64; struct LP_pubkeyinfo *pubp; char str[65],fname[512];
if ( fp == 0 )
{
sprintf(fname,"%s/PRICES/%s_%s",GLOBAL_DBDIR,base,rel), OS_ensure_directory(fname);
fp = OS_appendfile(fname);
}
if ( fp != 0 && price > SMALLVAL )
{
price64 = price * SATOSHIDEN;
now = (uint32_t)time(NULL);
fwrite(&now,1,sizeof(now),fp);
fwrite(&price64,1,sizeof(price64),fp);
fflush(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 )
{

1
iguana/exchanges/mm.c

@ -803,6 +803,7 @@ int main(int argc, const char * argv[])
OS_init();
sprintf(dirname,"%s",GLOBAL_DBDIR), OS_ensure_directory(dirname);
sprintf(dirname,"%s/SWAPS",GLOBAL_DBDIR), OS_ensure_directory(dirname);
sprintf(dirname,"%s/PRICES",GLOBAL_DBDIR), OS_ensure_directory(dirname);
if ( argc > 1 && (retjson= cJSON_Parse(argv[1])) != 0 )
{
if ( (passphrase= jstr(retjson,"passphrase")) == 0 )

Loading…
Cancel
Save