Cross copy
This commit is contained in:
@@ -1203,7 +1203,7 @@ UniValue prices(const UniValue& params, bool fHelp)
|
|||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "illegal numpricefeeds");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "illegal numpricefeeds");
|
||||||
prices = (uint32_t *)calloc(sizeof(*prices),width*numpricefeeds);
|
prices = (uint32_t *)calloc(sizeof(*prices),width*numpricefeeds);
|
||||||
correlated = (int64_t *)calloc(sizeof(*correlated),width);
|
correlated = (int64_t *)calloc(sizeof(*correlated),width);
|
||||||
for (ht=nextheight-1,i=0; i<numpricefeeds&&ht>2*daywindow+2; i++,ht--)
|
for (ht=nextheight-1,i=0; i<width&&ht>2*daywindow+2; i++,ht--)
|
||||||
{
|
{
|
||||||
if ( ht < 0 || ht > chainActive.Height() )
|
if ( ht < 0 || ht > chainActive.Height() )
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
|
||||||
@@ -1215,8 +1215,12 @@ UniValue prices(const UniValue& params, bool fHelp)
|
|||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "numprices != first numprices");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "numprices != first numprices");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (j=0; j<n; j++)
|
for (j=0; j<numpricefeeds; j++)
|
||||||
prices[j*width + i] = rawprices[i];
|
{
|
||||||
|
prices[j*width + i] = rawprices[j];
|
||||||
|
if ( j == 1 )
|
||||||
|
fprintf(stderr,"[%d] <- %.1f ",j*width+i,(double)rawprices[j]/10000)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else throw JSONRPCError(RPC_INVALID_PARAMETER, "no komodo_rawprices found");
|
} else throw JSONRPCError(RPC_INVALID_PARAMETER, "no komodo_rawprices found");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user