|
|
@ -777,7 +777,7 @@ void LP_pricesparse(void *ctx,int32_t trexflag,char *retstr,struct LP_priceinfo |
|
|
|
|
|
|
|
void prices_loop(void *ignore) |
|
|
|
{ |
|
|
|
char *retstr; cJSON *retjson; int32_t i; struct LP_priceinfo *btcpp; void *ctx = bitcoin_ctx(); |
|
|
|
char *retstr; cJSON *retjson; int32_t i; double price; struct LP_priceinfo *btcpp,*kmdpp,*fiatpp; void *ctx = bitcoin_ctx(); |
|
|
|
while ( 1 ) |
|
|
|
{ |
|
|
|
if ( LP_autoprices == 0 ) |
|
|
@ -806,12 +806,21 @@ void prices_loop(void *ignore) |
|
|
|
} |
|
|
|
LP_pricesparse(ctx,0,retstr,btcpp); |
|
|
|
free(retstr); |
|
|
|
for (i=0; i<32; i++) |
|
|
|
if ( (kmdpp= LP_priceinfofind("KMD")) != 0 ) |
|
|
|
{ |
|
|
|
if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) |
|
|
|
for (i=0; i<32; i++) |
|
|
|
{ |
|
|
|
printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); |
|
|
|
free_json(retjson); |
|
|
|
if ( (fiatpp= LP_priceinfofind(CURRENCIES[i])) != 0 ) |
|
|
|
{ |
|
|
|
if ( (retjson= LP_paxprice(CURRENCIES[i])) != 0 ) |
|
|
|
{ |
|
|
|
printf("(%s %.8f %.8f) ",CURRENCIES[i],jdouble(retjson,"price"),jdouble(retjson,"invprice")); |
|
|
|
price = jdouble(retjson,"invprice"); |
|
|
|
LP_autopriceset(ctx,1,kmdpp,fiatpp,price); |
|
|
|
LP_autopriceset(ctx,-1,fiatpp,kmdpp,price); |
|
|
|
free_json(retjson); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
sleep(60); |
|
|
|