From 10f6aa68908bb106cdf1096f51107c1a381fc5b6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 29 Mar 2019 02:38:08 -1100 Subject: [PATCH] get_dailyfx --- src/komodo_gateway.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index ca924a770..4dcefd217 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1847,6 +1847,17 @@ uint32_t get_stockprice(const char *symbol) return(price); } +uint32_t get_dailyfx() +{ + char url[512]; cJSON *json; uint32_t datenum=0,price = 0; + sprintf(url,"https://api.exchangeratesapi.io/latest"); + if ( (json= get_urljson(url)) != 0 ) + { + free_json(json); + } + return(datenum); +} + uint32_t get_currencyprice(const char *symbol) { char url[512]; cJSON *json,*obj; uint32_t price = 0; @@ -1934,7 +1945,7 @@ void komodo_cbopretupdate() // fprintf(stderr,"%02x",Mineropret[i]); //fprintf(stderr," <- set Mineropret[%d]\n",(int32_t)Mineropret.size()); } -ASSETCHAINS_CBOPRET = 5; + get_dailyfx(); if ( (ASSETCHAINS_CBOPRET & 2) != 0 ) { get_currencies(Cryptos,(int32_t)(sizeof(Cryptos)/sizeof(*Cryptos)));