Iter + seed
This commit is contained in:
@@ -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 )
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user