test
This commit is contained in:
@@ -40,7 +40,7 @@ void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t heig
|
||||
{
|
||||
struct komodo_event_notarized N;
|
||||
if ( komodo_verifynotarization(symbol,dest,height,notarizedheight,notarized_hash,notarized_desttxid) != 0 )
|
||||
printf("%s error validating notarization\n",ASSETCHAINS_SYMBOL);
|
||||
printf("[%s] error validating notarization ht.%d notarized_height.%d\n",ASSETCHAINS_SYMBOL,height,notarizedheight);
|
||||
else
|
||||
{
|
||||
memset(&N,0,sizeof(N));
|
||||
|
||||
@@ -451,7 +451,7 @@ uint64_t _komodo_paxprice(uint64_t *kmdbtcp,uint64_t *btcusdp,int32_t height,cha
|
||||
return(0);
|
||||
}
|
||||
|
||||
uint64_t komodo_paxpriceB(uint64_t *seedp,int32_t height,char *base,char *rel,uint64_t basevolume)
|
||||
uint64_t komodo_paxpriceC(uint64_t *seedp,int32_t height,char *base,char *rel,uint64_t basevolume)
|
||||
{
|
||||
int32_t i,j,k,ind,zeroes,numvotes,wt,nonz; int64_t delta; uint64_t lastprice,tolerance,den,densum,sum=0,votes[sizeof(Peggy_inds)/sizeof(*Peggy_inds)],btcusds[sizeof(Peggy_inds)/sizeof(*Peggy_inds)],kmdbtcs[sizeof(Peggy_inds)/sizeof(*Peggy_inds)],kmdbtc,btcusd;
|
||||
*seedp = komodo_seed(height);
|
||||
@@ -491,12 +491,28 @@ uint64_t komodo_paxpriceB(uint64_t *seedp,int32_t height,char *base,char *rel,ui
|
||||
return(komodo_paxcorrelation(votes,numvotes,*seedp) * basevolume / 100000);
|
||||
}
|
||||
|
||||
uint64_t komodo_paxpriceB(uint64_t *seedp,int32_t height,char *base,char *rel,uint64_t basevolume)
|
||||
{
|
||||
int32_t i,nonz=0; uint64_t price,seed,sum = 0;
|
||||
for (i=0; i<2; i++)
|
||||
{
|
||||
if ( (price= komodo_paxpriceC(&seed,height-i,base,rel,basevolume)) != 0 )
|
||||
{
|
||||
sum += price;
|
||||
nonz++;
|
||||
}
|
||||
}
|
||||
if ( nonz != 0 )
|
||||
sum /= nonz;
|
||||
return(sum);
|
||||
}
|
||||
|
||||
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;
|
||||
for (i=0; i<64; i++)
|
||||
for (i=0; i<2; i++)
|
||||
{
|
||||
if ( (price= komodo_paxpriceB(&seed,height-i,base,rel,basevolume)) != 0 )
|
||||
if ( (price= komodo_paxpriceB(&seed,height-i*16,base,rel,basevolume)) != 0 )
|
||||
{
|
||||
sum += price;
|
||||
nonz++;
|
||||
|
||||
Reference in New Issue
Block a user