Iter + seed

This commit is contained in:
jl777
2019-04-02 05:28:11 -11:00
parent 2417ee8787
commit 9070b3298f
2 changed files with 2 additions and 3 deletions

View File

@@ -2242,7 +2242,7 @@ int64_t komodo_pricecorrelated(uint64_t seed,int32_t ind,uint32_t *rawprices,int
for (iter=0; iter<daywindow; iter++)
{
correlation = 0;
i = (j + seed) % daywindow;
i = (iter + seed) % daywindow;
refprice = rawprices[i];
highprice = (refprice * (COIN + PRICES_MAXCHANGE*3)) / COIN;
lowprice = (refprice * (COIN - PRICES_MAXCHANGE*3)) / COIN;
@@ -2264,7 +2264,7 @@ int64_t komodo_pricecorrelated(uint64_t seed,int32_t ind,uint32_t *rawprices,int
if ( correlation > (daywindow>>1) )
{
n = 0;
i = (j + seed) % daywindow;
i = (iter + seed) % daywindow;
for (k=0; k<daywindow; k++,i++)
{
if ( i >= daywindow )

View File

@@ -1241,7 +1241,6 @@ UniValue prices(const UniValue& params, bool fHelp)
for (i=0; i<maxsamples+daywindow; i++)
{
offset = j*width + i;
//memcpy(prices2,&prices[offset],sizeof(*prices2)*daywindow);
if ( (correlated[i]= komodo_pricecorrelated(rngval,j,&prices[offset],daywindow,prices2)) < 0 )
throw JSONRPCError(RPC_INVALID_PARAMETER, "null correlated price");
}