Browse Source

NOT raw prices, that is just single blocks data

z_createrawtransaction
jl777 5 years ago
parent
commit
b3dcecb706
  1. 2
      src/komodo_gateway.h
  2. 6
      src/rpc/blockchain.cpp

2
src/komodo_gateway.h

@ -2199,6 +2199,7 @@ char *komodo_pricename(char *name,int32_t ind)
if ( ind < sizeof(Forex)/sizeof(*Forex) )
{
strcpy(name,Forex[ind]);
strcat(name,"USD");
return(name);
} else ind -= sizeof(Forex)/sizeof(*Forex);
}
@ -2209,6 +2210,7 @@ char *komodo_pricename(char *name,int32_t ind)
if ( ind < sizeof(Cryptos)/sizeof(*Cryptos) )
{
strcpy(name,Cryptos[ind]);
strcat(name,"BTC");
return(name);
} else ind -= sizeof(Cryptos)/sizeof(*Cryptos);
}

6
src/rpc/blockchain.cpp

@ -1224,7 +1224,7 @@ UniValue prices(const UniValue& params, bool fHelp)
for (i=0; i<maxsamples; i++)
{
UniValue timestamps(UniValue::VARR);
timestamps.push_back((int64_t)rawprices[i]);
timestamps.push_back((int64_t)prices[i]);
timestamps.push_back((int64_t)komodo_heightstamp(nextheight-1-i));
ret.push_back(Pair("timestamps",timestamps));
ret.push_back(Pair("firstheight", (int64_t)nextheight-1-i));
@ -1239,14 +1239,14 @@ UniValue prices(const UniValue& params, bool fHelp)
for (i=0; i<maxsamples+daywindow; i++)
{
offset = j*width + i;
correlated[i] = komodo_pricecorrelated(&rawprices[offset],daywindow);
correlated[i] = komodo_pricecorrelated(&prices[offset],daywindow);
}
for (i=0; i<maxsamples; i++)
{
offset = j*width + i;
smoothed = komodo_pricesmoothed(&correlated[i],daywindow);
UniValue parr(UniValue::VARR);
parr.push_back((uint64_t)rawprices[offset]);
parr.push_back((uint64_t)prices[offset]);
parr.push_back(ValueFromAmount(correlated[i]));
parr.push_back(ValueFromAmount(smoothed));
prices.push_back(parr);

Loading…
Cancel
Save