test
This commit is contained in:
@@ -429,7 +429,7 @@ uint64_t _komodo_paxprice(uint64_t *kmdbtcp,uint64_t *btcusdp,int32_t height,cha
|
|||||||
height -= 10;
|
height -= 10;
|
||||||
if ( (baseid= komodo_baseid(base)) >= 0 && (relid= komodo_baseid(rel)) >= 0 )
|
if ( (baseid= komodo_baseid(base)) >= 0 && (relid= komodo_baseid(rel)) >= 0 )
|
||||||
{
|
{
|
||||||
portable_mutex_lock(&komodo_mutex);
|
//portable_mutex_lock(&komodo_mutex);
|
||||||
for (i=NUM_PRICES-1; i>=0; i--)
|
for (i=NUM_PRICES-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
ptr = &PVALS[36 * i];
|
ptr = &PVALS[36 * i];
|
||||||
@@ -440,13 +440,13 @@ uint64_t _komodo_paxprice(uint64_t *kmdbtcp,uint64_t *btcusdp,int32_t height,cha
|
|||||||
*kmdbtcp = ptr[MAX_CURRENCIES + 1] / 539;
|
*kmdbtcp = ptr[MAX_CURRENCIES + 1] / 539;
|
||||||
*btcusdp = ptr[MAX_CURRENCIES + 2] / 539;
|
*btcusdp = ptr[MAX_CURRENCIES + 2] / 539;
|
||||||
}
|
}
|
||||||
portable_mutex_unlock(&komodo_mutex);
|
//portable_mutex_unlock(&komodo_mutex);
|
||||||
if ( kmdbtc != 0 && btcusd != 0 )
|
if ( kmdbtc != 0 && btcusd != 0 )
|
||||||
return(komodo_paxcalc(&ptr[1],baseid,relid,basevolume,kmdbtc,btcusd));
|
return(komodo_paxcalc(&ptr[1],baseid,relid,basevolume,kmdbtc,btcusd));
|
||||||
else return(0);
|
else return(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
portable_mutex_unlock(&komodo_mutex);
|
//portable_mutex_unlock(&komodo_mutex);
|
||||||
} //else printf("paxprice invalid base.%s %d, rel.%s %d\n",base,baseid,rel,relid);
|
} //else printf("paxprice invalid base.%s %d, rel.%s %d\n",base,baseid,rel,relid);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
@@ -494,7 +494,8 @@ uint64_t komodo_paxpriceB(uint64_t *seedp,int32_t height,char *base,char *rel,ui
|
|||||||
uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uint64_t basevolume)
|
uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uint64_t basevolume)
|
||||||
{
|
{
|
||||||
int32_t i,nonz=0; uint64_t price,seed,sum = 0;
|
int32_t i,nonz=0; uint64_t price,seed,sum = 0;
|
||||||
for (i=0; i<16; i++)
|
portable_mutex_lock(&komodo_mutex);
|
||||||
|
for (i=0; i<64; i++)
|
||||||
{
|
{
|
||||||
if ( (price= komodo_paxpriceB(&seed,height-i,base,rel,basevolume)) != 0 )
|
if ( (price= komodo_paxpriceB(&seed,height-i,base,rel,basevolume)) != 0 )
|
||||||
{
|
{
|
||||||
@@ -504,6 +505,7 @@ uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uin
|
|||||||
if ( height < 1500 ) // set to future height
|
if ( height < 1500 ) // set to future height
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
portable_mutex_unlock(&komodo_mutex);
|
||||||
if ( nonz != 0 )
|
if ( nonz != 0 )
|
||||||
sum /= nonz;
|
sum /= nonz;
|
||||||
return(sum);
|
return(sum);
|
||||||
|
|||||||
Reference in New Issue
Block a user