This commit is contained in:
@@ -1578,7 +1578,7 @@ uint32_t komodo_pricenew(uint32_t price,uint32_t refprice,int64_t tolerance)
|
|||||||
uint32_t highprice,lowprice;
|
uint32_t highprice,lowprice;
|
||||||
highprice = ((uint64_t)refprice * (COIN + tolerance)) / COIN;
|
highprice = ((uint64_t)refprice * (COIN + tolerance)) / COIN;
|
||||||
lowprice = ((uint64_t)refprice * (COIN - tolerance)) / COIN;
|
lowprice = ((uint64_t)refprice * (COIN - tolerance)) / COIN;
|
||||||
fprintf(stderr,"%.4f -> (%.4f %.4f)\n",(double)price/10000,(double)lowprice/10000,(double)highprice/10000);
|
//fprintf(stderr,"%.4f -> (%.4f %.4f)\n",(double)price/10000,(double)lowprice/10000,(double)highprice/10000);
|
||||||
if ( price > highprice )
|
if ( price > highprice )
|
||||||
return(highprice);
|
return(highprice);
|
||||||
else if ( price < lowprice )
|
else if ( price < lowprice )
|
||||||
@@ -1602,7 +1602,7 @@ int32_t komodo_priceclamp(uint32_t pricebits[4],uint32_t refprices[4],int64_t to
|
|||||||
{
|
{
|
||||||
if ( (newprice= komodo_pricenew(pricebits[i],refprices[i],tolerance)) != 0 )
|
if ( (newprice= komodo_pricenew(pricebits[i],refprices[i],tolerance)) != 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"priceclamp[%d] %u -> %u\n",i,pricebits[i],newprice);
|
fprintf(stderr,"priceclamped[%d] %u -> %u\n",i,pricebits[i],newprice);
|
||||||
pricebits[i] = newprice;
|
pricebits[i] = newprice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user