First version correlator

This commit is contained in:
jl777
2019-04-02 03:16:20 -11:00
parent b952e57e95
commit 4b7a2ca365
2 changed files with 35 additions and 11 deletions

View File

@@ -1238,7 +1238,8 @@ UniValue prices(const UniValue& params, bool fHelp)
for (i=0; i<maxsamples+daywindow; i++)
{
offset = j*width + i;
correlated[i] = komodo_pricecorrelated(seed,j,&prices[offset],daywindow);
if ( (correlated[i]= komodo_pricecorrelated(seed,j,&prices[offset],daywindow)) < 0 )
throw JSONRPCError(RPC_INVALID_PARAMETER, "null correlated price");
}
for (i=0; i<maxsamples; i++)
{
@@ -1256,6 +1257,7 @@ UniValue prices(const UniValue& params, bool fHelp)
}
ret.push_back(Pair("pricefeeds",a));
ret.push_back(Pair("result","success"));
ret.push_back(Pair("seed",(int64_t)seed));
ret.push_back(Pair("height",(int64_t)nextheight-1));
ret.push_back(Pair("maxsamples",(int64_t)maxsamples));
ret.push_back(Pair("width",(int64_t)width));