This commit is contained in:
jl777
2019-04-02 23:47:37 -11:00
parent 5d861c188a
commit f8b7e0480f
3 changed files with 28 additions and 3 deletions

View File

@@ -2109,7 +2109,8 @@ int32_t get_btcusd(uint32_t pricebits[4])
int32_t komodo_cbopretsize(uint64_t flags)
{
int32_t size = 0;
int32_t size = 0; uint32_t cryptoprices[sizeof(Cryptos)/sizeof(*Cryptos)],forexprices[sizeof(Forex)/sizeof(*Forex)];
if ( (ASSETCHAINS_CBOPRET & 1) != 0 )
{
size = PRICES_SIZEBIT0;

View File

@@ -1665,6 +1665,7 @@ uint64_t komodo_ac_block_subsidy(int nHeight)
extern int64_t MAX_MONEY;
void komodo_cbopretupdate(int32_t forceflag);
void SplitStr(const std::string& strVal, std::vector<std::string> outVals);
void komodo_args(char *argv0)
{
@@ -1814,9 +1815,9 @@ void komodo_args(char *argv0)
ASSETCHAINS_CBOPRET = GetArg("-ac_cbopret",0);
if ( ASSETCHAINS_CBOPRET != 0 )
{
Split(GetArg("-ac_prices",""), ASSETCHAINS_PRICES, 0);
SplitStr(GetArg("-ac_prices",""), ASSETCHAINS_PRICES);
for (i=0; i<ASSETCHAINS_PRICES.size(); i++)
fprintf(stderr,"%s ",ASSETCHAINS_PRICES[i]);
fprintf(stderr,"%s ",ASSETCHAINS_PRICES[i].c_str());
fprintf(stderr,"%d -ac_prices\n",(int32_t)ASSETCHAINS_PRICES.size());
}
hexstr = GetArg("-ac_mineropret","");

View File

@@ -394,6 +394,29 @@ void ParseParameters(int argc, const char* const argv[])
}
}
void SplitStr(const std::string& strVal, std::vector<std::string> outVals)
{
stringstream ss(strVal);
vector<std::string> str;
while ( ss.peek() == ' ' )
ss.ignore();
while ( ss >> str )
{
//outVals[numVals] = i;
outVals.push_back(i);
numVals += 1;
while ( ss.peek() == ' ' )
ss.ignore();
if ( ss.peek() == ',' )
ss.ignore();
while ( ss.peek() == ' ' )
ss.ignore();
}
}
void Split(const std::string& strVal, uint64_t *outVals, const uint64_t nDefault)
{
stringstream ss(strVal);