komodo_pricesinit
This commit is contained in:
@@ -85,5 +85,6 @@ int tx_height( const uint256 &hash );
|
||||
extern std::vector<std::string> vWhiteListAddress;
|
||||
void komodo_netevent(std::vector<uint8_t> payload);
|
||||
int32_t komodo_priceind(char *symbol);
|
||||
void komodo_pricesinit();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2526,3 +2526,19 @@ int64_t komodo_pricesmoothed(int64_t *correlated,int32_t cskip,int64_t *rawprice
|
||||
return(price);
|
||||
}
|
||||
|
||||
void komodo_pricesinit()
|
||||
{
|
||||
FILE *fp; char symbol[65]; int32_t i;
|
||||
boost::filesystem::path pricefname,pricesdir = GetDataDir() / "prices";
|
||||
if (!boost::filesystem::exists(pricesdir))
|
||||
{
|
||||
boost::filesystem::create_directories(pricesdir);
|
||||
for (i=0; i<KOMODO_MAXPRICES; i++)
|
||||
{
|
||||
if ( komodo_pricename(symbol,i) == 0 )
|
||||
break;
|
||||
pricefname = pricesdir / symbol;
|
||||
fp = fopen(pricefname.string().c_str(), "wb+");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2082,6 +2082,7 @@ void komodo_args(char *argv0)
|
||||
extralen += symbol.size();
|
||||
}
|
||||
}
|
||||
komodo_pricesinit();
|
||||
komodo_cbopretupdate(1); // will set Mineropret
|
||||
fprintf(stderr,"This blockchain uses data produced from CoinDesk Bitcoin Price Index\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user